$befal = mysql_query('SELECT * FROM users WHERE username = $_GET[username]'); $rad = mysql_fetch_assoc($befal);
Equals
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\profile.php on line 4
I have a user called Admin in the field username and it still dont work. profile.php?user=Admin…
This works if I use the ID though:
$befal = mysql_query('SELECT * FROM users WHERE user_id = $_GET[id]'); $rad = mysql_fetch_assoc($befal);
What can be the problem?
Thanks
Try it like this:
You have to encapsulate a string parameter in apostrophes.
[UPDATE]
Just like cletus and Olaf pointed out, with the above sql statement you are very prone to SQL Injection. Check out their posted answers to see what I mean.