Re: Returning all rows

From: Date: Mon, 20 May 2002 16:47:27 +0000
Subject: Re: Returning all rows
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-19280@lists.php.net to get a copy of this message
Echo your data in the loop. like this: $sql= "SELECT id, city, date FROM meetings WHERE city = \"$city\" "; $result = mysql_query($sql,$connection) or die("Couldn't execute query"); while ($row = mysql_fetch_array($result)) { $id = $row["id"]; $city = $row["city"]; $date = $row["date"]; echo "$date"; } ----- Original Message ----- From: "Todd Williamsen" <todd@williamsen.net> To: <php-db@lists.php.net> Sent: Monday, May 20, 2002 5:01 PM Subject: [PHP-DB] Returning all rows > I know I have asked this silly question before, but forgive me since I have > been a bit rusty with PHP lately > > So how do I return all rows? > > I have this: > > $sql= "SELECT id, city, date FROM meetings WHERE city = \"$city\" "; > $result = mysql_query($sql,$connection) or die("Couldn't execute query"); > while ($row = mysql_fetch_array($result)) { > $id = $row["id"]; > $city = $row["city"]; > $date = $row["date"]; > } > echo "$date"; > ?> > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.db (#19280) next »