RE: unable to login to oracle database using php.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
To: php-db@xxxxxxxxxxxxx
Subject:  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

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux