note 35475 rejected from function.mysql-fetch-array by vincent

From: Date: Tue, 02 Sep 2003 13:22:11 +0000
Subject: note 35475 rejected from function.mysql-fetch-array by vincent
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-55469@lists.php.net to get a copy of this message
Note Submitter: plugboy2@hotmail.com ---- I'm looking to test if a variable is alread in the database or not but it keeps telling me that "Supplied argument is not a valid MySQL result resource on line 8" $result = mysql_query("SELECT name FROM trivia_pheonix WHERE name=$name"); while($row = mysql_fetch_array($result)) //line 8 { if ($name == $row[name]) { $update = mysql_query("UPDATE trivia_pheonix SET point=point+$points,spoint=spoint+$spoints WHERE name=$name"); print ("<br>Person score updated successfully"); } else { $add = mysql_query("INSERT INTO trivia_pheonix VALUES ('$name', '$points', '$spoints')"); print ("<br>Person added to the scores successfully"); } }

« previous php.notes (#55469) next »