mySQL query grief

From: Date: Sun, 22 Jul 2001 10:15:28 +0000
Subject: mySQL query grief
Groups: php.general 
Request: Send a blank email to php-general+get-59053@lists.php.net to get a copy of this message
Hi all, newbie to MySQL... I get this error: Supplied argument is not a valid MySQL result resource in /usr/local/ blah blah blah From this query: $username = "juddy2"; $sql = "SELECT * FROM staff WHERE id=".$username; $result = mysql_query($sql); However, this works okay: $username = "juddy2"; $sql = "SELECT * FROM staff"; $result = mysql_query($sql); So, I guess my WHERE... stuff is wrong. I just want to retrieve the whole row of information relating to a certain user (eg juddy2). The usernames are unique in the table, contained in a column called "id". Many Thanks in advance Justin French

« previous php.general (#59053) next »