ABOUT,
this is really the bottom line where the question arises. But you may need other information after this, for example, how I connected, etc., to avoid misunderstandings. :)
$con = mysql_connect('localhost', 'root', '******'); if(!$con) { die('Could not establish connection: ' . mysql_error); } mysql_select_db('hunkusersystem'); function user_login($username, $password) { //Avoid SQL-injections. $username = mysql_real_escape_string($username); $password = md5($password); //Match user and password $sql = mysql_query("SELECT * FROM usersystem WHERE username = '$username' AND password = '$password' LIMIT 1", **$con**);
My question is, in the very last block of code, I cannot use the resource identifier .. Why is this? Is it because mysql_select_db will be "cleaned up"? So, are you standing with the right connection, but without a database? If I used multiple connections, I must define the connection in mysql_select_db ();
Thanks so much for your help :) Greetings from Swe.
source share