Ingres Community Forums Login Register Ingres.com  

Ingres Community Forum


Go Back   Ingres Community Forums > Ingres Forums > Database Drivers and APIs > PHP
 

Reply
 
LinkBack Thread Tools Display Modes
Old 2009-03-03   #1 (permalink)
Junior Member
 
Join Date: Feb 2009
Posts: 1
Exclamation Ingres PHP Driver functionality

Hello,
I could not find the syntax for the following functions:

1. ingres_set_environment()

This function is used to set one or more Ingres environment variables. But I'm not sure which environment variables it can set.

2. ingres_execute()

This function executes the cursor prepared by the ingres_prepare() function. I tried the following script:

<?php
$database='phpdb_unicode';
$user='ingres';
$password='ingresnt';
$conn = ingres_pconnect($database,$user,$password);
if($conn) {
echo "connection established";
$ingpre=ingres_prepare($conn,"select * from param_tests ");
if($ingpre) {
echo "\n","cursor prepared";
echo "\n", ingres_cursor($ingpre), "\n";
$exec=ingres_execute($ingpre);
if(is_resource(ingres_execute($ingpre))) {
echo "cursor execution is done"; }
else {
echo "cursor failed to execute"; } }
else {
echo "ingres_prepare() failed to create a cursor";} }
else { echo "connection failed";}
?>

Output for the above script:
connection established
cursor prepared
php_4696_1
cursor failed to execute

3. ingres_fetch_proc_return()

I tried implementing the above three functions, but some how couldn't succeed. Please help me out with examples or syntaxes.

Sivakumar.A
sivakumar is offline   Reply With Quote
Old 2009-03-03   #2 (permalink)
Ingres Staff
 
grant's Avatar
 
Join Date: Mar 2007
Location: Valladolid, EspaƱa
Posts: 381
Blog Entries: 1
Send a message via MSN to grant
Default

Hi
Quote:
Originally Posted by sivakumar View Post
Hello,
I could not find the syntax for the following functions:

1. ingres_set_environment()

This function is used to set one or more Ingres environment variables. But I'm not sure which environment variables it can set.
See Set environment features controlling output options, the docs for the PHP extension are currently undergoing a review (http://community.ingres.com/wiki/PHP_Doc_Review)

Quote:
Originally Posted by sivakumar View Post
2. ingres_execute()

This function executes the cursor prepared by the ingres_prepare() function. I tried the following script:

<?php
$database='phpdb_unicode';
$user='ingres';
$password='ingresnt';
$conn = ingres_pconnect($database,$user,$password);
if($conn) {
echo "connection established";
$ingpre=ingres_prepare($conn,"select * from param_tests ");
if($ingpre) {
echo "\n","cursor prepared";
echo "\n", ingres_cursor($ingpre), "\n";
$exec=ingres_execute($ingpre);
if(is_resource(ingres_execute($ingpre))) {
echo "cursor execution is done"; }
else {
echo "cursor failed to execute"; } }
else {
echo "ingres_prepare() failed to create a cursor";} }
else { echo "connection failed";}
?>

Output for the above script:
connection established
cursor prepared
php_4696_1
cursor failed to execute
I need to document these two functions. In addition it looks like you have hit a bug. Can you raise an issue via - PECL :: Report - New.

Quote:
Originally Posted by sivakumar View Post
3. ingres_fetch_proc_return()
Also needs documenting - seems I forgot about this.

Quote:
Originally Posted by sivakumar View Post
I tried implementing the above three functions, but some how couldn't succeed. Please help me out with examples or syntaxes.

Sivakumar.A
__________________
Ingres PHP and Ruby Maintainer
http://blogs.planetingres.org/grant
grant is offline   Reply With Quote

Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


© 2009 Ingres Corporation. All Rights Reserved