Ingres Community Forums Login Register Ingres.com  

Ingres Community Wiki

Navigation
Learn About
Developing With
Ingres Talk
Information
Toolbox

PHP - Execute a simple select using a parameter - fetch object

From Ingres Community Wiki

Jump to: navigation, search
<?php

$database='dbname';
$user='user';
$password='password';


$conn = ingres_connect($database,$user,$password);

if ($conn) {
    echo "Connection succeeded.";
        $param = array("iirelation");
        $rc=ingres_query($conn,"select * from iirelation where relid=?",$param);
        if (is_resource($rc)) {
                echo "Query succeeded.";
                while ($object=ingres_fetch_object($rc)) {
                        echo $object->relowner;
                }
        } else {
                echo "Query failed.";
        }
    ingres_close($conn);
} else {
    echo "Connection failed.";
}

?>

Back to PHP Driver Examples

Personal tools
© 2009 Ingres Corporation. All Rights Reserved