note 5344 modified in mysql_query by ronabop

From: Date: Sat, 12 Aug 2000 22:32:52 +0000
Subject: note 5344 modified in mysql_query by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-1703@lists.php.net to get a copy of this message
Examples: $result = mysql_db_query("db_name","sql statement"); 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) $result = mysql_db_query("db_name","sql statement"); if ($row = mysql_fetch_row($result)) { do { print $row[0]; print $row[1]; ..etc... } while ($row = mysql_fetch_row($result)); // end while : prints each row } else { print "No results"; } // end if : checks for rows to select I hope this helps. Dave Beaudoin, Webmaster http://www.e-underground.net/ http://www.php.net/manual/function.mysql-query.php

« previous php.notes (#1703) next »