note 71540 deleted from function.ifx-query by didou
| From: | didou@php.net | Date: | Sat, 03 Feb 2007 03:51:58 +0000 |
| Subject: | note 71540 deleted from function.ifx-query by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-122645@lists.php.net to get a copy of this message | ||
Note Submitter: dorn at janejit dot com
----
<?php
$database = "database";
$user = "user";
$pass = "password";
if (!$connect_ifx = ifx_connect("$database@$host", $user, $pass)) {
echo "Unable to connect to Informix Database\n";
exit();
}
$sql_pre = "SET LOCK MODE TO WAIT 2";
$sql_main = "SELECT col1, col2 FROM table1;";
$pre_sql = ifx_prepare($sql_pre, $connect_ifx);
$lock_exe = ifx_do($pre_sql);
if (!$main_sql = ifx_query($sql_main, $connect_ifx)) {
echo "Informix query failed\n";
exit();
}
while ($row = ifx_fetch_row($main_sql)) {
$col1 = $row['col1'];
$col2 = $row['col2'];
echo "$col1, $col2\n";
}
ifx_free_result($main_sql);
ifx_close($connect_ifx);
?>