I am really new at SQL and PHP. Basically I need to store a query result into a variable. I have something like this:
$id = mysql_query("SELECT id FROM users WHERE name = ($user)");
So I want $id
to have the value of id from table users
where the name
field in users table = $user
(value of a logged-in user).
May I know how to make this work?