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;


From: babu <[EMAIL PROTECTED]>
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)

I have a small problem.
I am trying to connect to oracle using php.i get strange results.please see the code below.

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>";
echo "</p>";
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

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to