note 45521 deleted from function.oci-connect by tomsommer
| From: | tomsommer@php.net | Date: | Thu, 09 Sep 2004 20:24:47 +0000 |
| Subject: | note 45521 deleted from function.oci-connect by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-76347@lists.php.net to get a copy of this message | ||
Note Submitter: chris at zeronexus dot com
----
If you are used to using mysql, this might be helpful.
<?php
// oracle functions
function oracle_query( $sql, $conn )
{
$statement = @oci_parse($conn, $sql);
if( !$statement )
{
$e = oci_error($conn); // For oci_parse errors pass the connection handle
echo htmlentities($e['message']);
return 0;
}
if( @oci_execute($statement, OCI_DEFAULT) )
{
$result = $statement;
if( !oci_free_statement($statement) )
{
$err = oci_error($statement);
echo "Oracle Error: " . $err['text'];
return 0;
}
else
{
return $result;
}
}
else
{
$err = oci_error($statement);
echo "Oracle Error: " . $err['text'];
return 0;
}
}
?>