Supplied argument is not a valid MySQL result resource

From: Date: Mon, 09 Apr 2001 22:42:06 +0000
Subject: Supplied argument is not a valid MySQL result resource
Groups: php.general 
Request: Send a blank email to php-general+get-47894@lists.php.net to get a copy of this message
I am trying to get to grips with managing data in mysql, am am currentky working on deleting records I have worked through a turorial - no problems, but now I am trying to apply it to my own database, I am getting the error Warning: Supplied argument is not a valid MySQL result resource in .... on line 14 I cannot see what is causing it - if anyone can it would be much appreciated. thanks Nathan For clarity/brevity I have cut the page back to what i beleive to be the relivant part. Code for page is:- <html> <body> <?php $db = mysql_connect("localhost", "username", "pasword"); mysql_select_db("catalogue",$db); $result = mysql_query("SELECT * FROM SECTIONS",$db); while ($myrow = mysql_fetch_array($result)) { printf("<a href=\"%s?section_id=%s\">%s %s</a> \n", $PHP_SELF, $myrow["section_id"], $myrow["section_name"], $myrow["section"]); printf("<a href=\"%s?id=%s&delete=yes\">(DELETE)</a><br>", $PHP_SELF, $myrow["section_id"]); } ?> </body> </html> SQL for the table is CREATE TABLE SECTIONS ( section_name varchar(25) NOT NULL, section_id tinyint(3) unsigned DEFAULT '0' NOT NULL auto_increment, section char(1) NOT NULL, PRIMARY KEY (section_id), UNIQUE section (section_name, section_id, section)

« previous php.general (#47894) next »