I'm following login/register tutorial in php and mysql. As you can see in this video: http://www.youtube.com/watch?v=JUk2e8oqOvI&list=PLE134D877783367C7
You can find function user_id_from_username on 06:28 minute.
I have exact function:
function user_id_from_username($username){
$username = sanitize($username);
return mysql_result(mysql_query("SELECT 'user_id' FROM 'users' WHERE 'username' = '$username'"), 0, 'user_id');
}
But this query never returns user_id. I tried to echo result of this query and I don't get anything. Database is ok, all other queries works fine. If I run this query in mysql workbench again it works. I don't know where is the problem. Can you help me.