RE: [PHP-DB] unable to login to oracle database using php.

From: Date: Wed, 15 Jun 2005 13:09:40 +0000
Subject: RE: [PHP-DB] unable to login to oracle database using php.
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-39679@lists.php.net to get a copy of this message
Duno what you want but from your description its working...$conn will return a HANDLE to the connection and that is the "Resource id #5 " message. On failure its shoudl return false which is correct also. I think you want to change your script to return $conn to the main script to be able to use it so return; should be return $conn; Bastien
From: babu <garavindbabu@yahoo.co.uk> To: php-db@lists.php.net Subject: [PHP-DB] unable to login to oracle database using php. Date: Wed, 15 Jun 2005 13:02:38 +0100 (BST) Hi, I have a small problem. I am trying to connect to oracle using php.i get strange results.please see the code below. code: function check_database($login,$password) { global $db; echo"checking authentication <br>"; $conn = ocilogon($login,$password,$db); echo "$conn"; if (!$conn) { echo("Error during ocilogon"); echo "<p>"; printLastError(); echo "</p>"; return; } echo" <br> after authentication"; } if(isset($checkpass)) { if(check_database($login, $password)) { echo "<h2>Login Success!</h2>"; } else { echo "<h2>Login Failed</h2><p>Bad username or password.Try again:"; } } in the above code for checking the authentication of login , there is some value assigned to $conn,"Resource id #5 ". and also if(!$conn)is not executed but after the funtion exit, the else statement (echo "<h2>Login Failed</h2>) is executed. can anyone tell me where the problem is. --------------------------------- How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos. Get Yahoo! Photos


« previous php.db (#39679) next »