OK, I wrote these 2 functions
[code=php]
function db_connect()
{
// connect to the database using the variables
// $dbhost, $dbuser, $dbpass, $dbname
$dbhost=’localhost’;
$dbuser=’test’;
$dbpass=’test’;
$dbname=’test’;
$db_connect=mysql_connect($dbhost, $dbuser, $dbpass);
if(!$db_connect)
{
echo “Could not connect to DB”;
}
else{
mysql_select_db($dbname, $db_connect);
}
}
function get_user_information($email, $password){
//function will be used to check if the
//information suplied by the user in the login page is correct
db_connect();
$query = mysql_query(‘SELECT * FROM user WHERE user_email=”‘.$email.'” and user_password=”‘.$password.'”;’);
$user_details=mysql_fetch_array($query);
return $user_details;
}
Bu the second function always returns a false result, although I am positiove I am supplying the correct email and password.
Any ideas why might it be?