note 71539 deleted from function.ifx-query by bjori
| From: | bjori@php.net | Date: | Tue, 05 Dec 2006 15:03:57 +0000 |
| Subject: | note 71539 deleted from function.ifx-query by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-120300@lists.php.net to get a copy of this message | ||
Note Submitter: dorn at janejit dot com
Reason: once is enough
----
<?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);
?>