PHP - Execute a simple select against default link - fetch assoc array

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.";
        $rc=ingres_query($conn,"select * from iirelation where relid='iirelation'");
        if (is_resource($rc)) {
                echo "Query succeeded.";
                while ($row=ingres_fetch_array($rc)) {
                        echo $row["relowner"];
                }
        } else {
                echo "Query failed.";
        }
    ingres_close($conn);
} else {
    echo "Connection failed.";
}

?>

Back to PHP Driver Examples

Personal tools
Developing With