note 5346 deleted from mysql_query by ronabop
| From: | ronabop@php.net | Date: | Sat, 12 Aug 2000 22:33:08 +0000 |
| Subject: | note 5346 deleted from mysql_query by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-1704@lists.php.net to get a copy of this message | ||
(Doh, didn't remember breaks! Sorry...)<P>
Paul-<BR>
I had the same problem when I was scripting the pages for my website. What worked for me was using a
slightly different query command. I'm not sure if this is just something my web-host
configured, but it works. Give this a shot...<P>
$result = mysql_db_query("db_name","sql statement");<P>
And as for iterating stuff over and over (like listing each row of a table), I use this construct...
(you'll see that I'm a fan of comments, especially for regex's)<P>
$result = mysql_db_query("db_name","sql statement");<BR>
if ($row = mysql_fetch_row($result)) {<P>
do {<BR>
print $row[0];<BR>
print $row[1];<BR>
..etc...<BR>
} while ($row = mysql_fetch_row($result)); // end while : prints each row<P>
} else {<BR>
print "No results";<BR>
} // end if : checks for rows to select<P>
I hope this helps.<P>
Dave Beaudoin, Webmaster<BR>
<a href="http://www.e-underground.net/">http://www.e-underground.net/</a><P>