When I make the query bellow I can do a password check and the password and it works.
How ever, when I try to extract the row id called id it returns 0 when it should be something else. And when I print the password the same way it prints two digits instead of the string I was hoping for.
I more or less a beginner to PHP but maybe someone could see whats wrong with my code?
$sql = 'SELECT pass FROM tbl_user WHERE email = "'.$email.'" LIMIT 1 ;';
$selection = mysql_query($sql);
$r = mysql_fetch_assoc($selection);
$user_id = $r['id'];
print "user id is: " + $r['id'];
print "user id is: " + $r['pass'];
You’re only
SELECTing the password. Change your query toWith regards to printing it, instead of using
print, useecho. Also, instead of+, use.to join strings together: