Help: Can't get results returned from query
Posted: Thu Jan 16, 2003 2:20 pm
Hi, I'm trying to connect to an Oracle DB from an NT/IIS/PHP server. I'm getting connected but the query isn't returning anything. I get the message that it connected successfully but then it just spins its wheels. Any help appreciated. Here is my test script.
<?PHP
if ($conn_id = odbc_connect("dev", "test", "test")) {
echo("Connection successful!");
$result = odbc_exec($conn_id, "SELECT SYSDATE FROM DUAL");
odbc_fetch_row($result);
$field1 = odbc_result($result, 1);
echo($field1);
odbc_close($conn_id);
} else {
echo("Cannot connect to data source");
}
?>
<?PHP
if ($conn_id = odbc_connect("dev", "test", "test")) {
echo("Connection successful!");
$result = odbc_exec($conn_id, "SELECT SYSDATE FROM DUAL");
odbc_fetch_row($result);
$field1 = odbc_result($result, 1);
echo($field1);
odbc_close($conn_id);
} else {
echo("Cannot connect to data source");
}
?>