Re: OCI Help...
| From: | kev | Date: | Fri, 09 Jun 2000 00:21:27 +0000 |
| Subject: | Re: OCI Help... | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-279@lists.php.net to get a copy of this message | ||
Hi Kevin....
Yes, your script will continue to run if OCILogon() returns a null value (or is it
'false'? I can't remember). If you'd prefer the script to stop on a connection
error, you could try:
if ( ! OCILogon($uname, $pass, $db) ) die( "Couldn't connect to database" );
As for the error message you're getting, typing "oerr ora 00022" as the oracle user
gives:
00022, 00000, "invalid session ID; access denied"
// *Cause: Either the session specified does not exist or the caller
// does not have the privilege to access it.
// *Action: Specify a valid session ID that you have privilege to access,
// that is either you own it or you have the CHANGE_USER privilege.
...and TBH I don't know what that means! Not sure what 'session' means in this
context, but it smells likes an invalid username/password or something. The second error will
disappear if you get the first one fixed.
Sorry I couldn't be more help.
- Kev
PS - Have you restarted Apache? In certain circumstances that can cure intermittent connection
problems.
Kevin Pate wrote:
> 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);
> 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. ?>