Hello,
Thank you for taking the time to review my question.
Problem:
Due to my password being rejected, php cannot retrieve data from the database.
Here is a copy of my code:
//
//password = bond007
function login($username, $password)
//check username and password with db
//if yes return true
//if no return false
{
// outputs the correct password
echo "<br><br>This is password $password<br><br>";
//connects to db with no problems+
$conn = db_connect();
if (!$conn)
return 0;
//This is the problem { passwd = password('$password') } it
//will fail the query everytime. If I just query the username,
//the function queries the database with no problems
$result = mysql_query("select * from user where username = '$username' AND passwd = password('$password')");
// outputs the correct password
echo "<br><br>This is password $password<br><br>";
// This outputs password('bond007')
echo "<br><br>This is password ('$password')<br><br>";
if (!$result)
return 0;
if (mysql_num_rows($result)>0)
return 1;
else
return 0;
}