Re: Supplied argument is not a valid MySQL result resource

From: Date: Wed, 11 Apr 2001 22:06:44 +0000
Subject: Re: Supplied argument is not a valid MySQL result resource
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-48211@lists.php.net to get a copy of this message
This happened to me when I used _affected_rows instead of _count make sure you're using the right function. that drove me nuts before I got it working, AND I followed the durn directions. chris On Tue, 10 Apr 2001 09:02:32 -0700, elias wrote: >can you show me some code? >basically when you provide an invalid link to any MySql function this error >occur. > >-elias >http://www.kameelah.org/eassoft > >""Nathan Roberts"" <Nathan@fpandts.com> wrote in message >news:9atdps$kgv$1@toye.p.sourceforge.net... >> 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) >> >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >> For additional commands, e-mail: php-general-help@lists.php.net >> To contact the list administrators, e-mail: php-list-admin@lists.php.net >> > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#48211) next »