Please, check the following code, when i run it, i get the following warning msg:
Warning: Supplied argument is not a valid OCI8-Statement resource in d:\orbit-2002-i\connect.php on line 37
could not execute
seems the problem is in ociexecute statement
<?php
PutEnv("ORACLE_SID=ORACLE-P");
$connection = ocilogon("web_access","web_access","omnidemo")
or die ("Could not Logon");
//Create SQL Statement
$sql = "SELECT FIRST_NAME FROM customer WHERE MAIN_USER_NAME='$username' and MAIN_PASSWORD='$password'"
or die ("Could not run sql statement");
//Parse SQL statement
$statement = "ociparse($connection, $sql)"
or die ("Could not parse sql statement");
//Execute sql query
Ociexecute($statement, OCI_DEFAULT)
or die ("could not execute sql statement");
//get number of rows, if 0 then false, if 1, then execute
$num = OCIRowCount($statement)
or die ("Could not count rows");
//present results on validity
if ($num == 1) {echo "<p>Welcome $username</p>";
}
else if ($num == 0) {
echo "sorry Mr. $username , You are not authorized";
}
php?>