# Connection to an Oracle database using oci8 functions on WINDOWS OS or LINUX, PHP version 4.3.6
# There will be some changes from the currently installed version 4.3.6 to version 5.0.0. At the
# Present moment version 5.0.0 is not considered stable, so until it is apply the following note when using oci
# to connect to oracle databases.
# Note: In PHP versions before 5.0.0 you must use ociexecute() instead of oci_execute().
# This is the case for most of the oci functions, i.e. ocilogon, ociparse...
# For further reference se bottom of page
$db = "devdb";
# or
$db = "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = database_host)(PORT = 10521))(CONNECT_DATA = (SID = D)))";
$username = "your username";
$password = "your password";
# open a connection
$conn = ocilogon($username, $password, $db);
# A sql table
$table = "my_sql_table";
# Prepare the sql statement
$stmt = ociparse($conn,"select * from $table");
# Execute the statement
ociexecute($stmt, OCI_DEFAULT);
# Fetch result
while ( OCIFetchInto ($stmt, $row, OCI_ASSOC) ) { # See also ocifetch
echo "<pre>";
print_r($row);
echo "</pre>";
}
http://www.netservice.php0h.com/?s=php