OCI Errors
| From: | Kevin Pate | Date: | Tue, 06 Jun 2000 22:02:05 +0000 |
| Subject: | OCI Errors | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-233@lists.php.net to get a copy of this message | ||
To all,
I am getting the following errors when I attempt to logon to Oracle. Sometimes it works, and
sometimes it doesn't. I assume that it is timing out running the ocilogon() function. Will
the script continue to run even if the ocilogon() function has not returned a value? Any help would
be appreciated.
Thanks,
Kevin Pate
kevin@patefamily.com
Here is the Oracle error message:
Warning: OCIStmtExecute: ORA-00022: invalid session ID; access denied in /home/httpd/html/login.php
on line 9
Warning: OCIFetchStatement: ORA-24374: define not done before fetch or execute and fetch in
/home/httpd/html/login.php on line 11
Here is my login.php code:
1. <?php
2.
3. require("/etc/global.php");
4.
5. $conn = OCILogon($uname,$passwd,$db);
6.
7. $stmt = OCIParse($conn,"select fname,lname,email,username,password from kpate.members
where username = '$username'");
8.
9. OCIExecute($stmt,OCI_DEFAULT);
10.
11. $nrows = OCIFetchStatement($stmt,$results);
12. if ( $nrows > 0 ) {
13. for ( $i = 0 ; $i < $nrows ; ++$i ) {
14. reset($results);
15. while (list ($key,$val) = each ($results)) {
16. if ($key == "PASSWORD") $passcheck = $val[$i];
17. if ($key == "FNAME") $firstname = $val[$i];
18. if ($key == "LNAME") $lastname = $val[$i];
19. if ($key == "EMAIL") $emailaddress = $val[$i];
20. }
21. }
22. if ($passcheck == $password) print "Welcome $firstname $lastname!<br>";
23. else {
24. print "<b>Incorrect Password - try again.</b><br><br>If you
have forgotten your password, we can email it to you. Just click on the button below. It will be
mailed to the email address that you entered during registration.<br>";
25.
26. print "<form method=post action=emailpasswd.php>";
27. print "<input type=hidden name=emailaddressform
value=$emailaddress><br>";
28. print "<input type=hidden name=usernameform value=$username><br>";
29. print "<input type=hidden name=passwordform value=$passcheck><br>";
30. print "<input type=submit name=submit value=\"Send Password!\">";
31. print "</form>";
32. }
33. }
34. else {
35. echo "<b>Your account was not found in our database. Please <a
href=\"newuserform.html\">register</a> with
PateFamily.com.<br><br>Thank you.</b><br>";
36. }
37. OCIFreeStatement($stmt);
38. OCILogoff($conn);
39.
40. ?>