RE: [PHP-DB] php/mySQL help

From: Date: Wed, 07 Feb 2001 21:41:38 +0000
Subject: RE: [PHP-DB] php/mySQL help
Groups: php.db 
Request: Send a blank email to php-db+get-6457@lists.php.net to get a copy of this message
I made some changes and the page is up but there is no drop-down menu.....don't i have to add some echo statements in here? --scott -----Original Message----- From: Stinsman, Scott [mailto:scott.stinsman@uphs.upenn.edu] Sent: Wednesday, February 07, 2001 4:29 PM To: 'andy@mainetoday.com'; 'php-db@lists.php.net' Subject: RE: [PHP-DB] php/mySQL help thanx andy-- i put this code on my page and now my whole page is blank. any clues? -----Original Message----- From: Andrew Rush [mailto:andy@mainetoday.com] Sent: Wednesday, February 07, 2001 4:14 PM To: Stinsman, Scott Subject: Re: [PHP-DB] php/mySQL help On Wednesday, February 7, 2001, at 04:00 PM, Stinsman, Scott wrote: > $db=mysql_connect("localhost", "*******", "********"); > > mysql_select_db("quickcit", $db) OR DIE ("died at connect"); > > $query = "SELECT DISTINCT Restaurant.Cuisine "; ^^^^^^^^ notice the addition of the DISTINCT keyword. this will keep this code useable when you get more than one type of restaurant for each cuisine type > $query .= "FROM Restaurant "; > $query .= "ORDER BY Restaurant.Cuisine ASC "; if($result=mysql_query($query, $db) OR DIE ("died at query")) { $select="<select name=\"cuisine\">\n"; while(list($cuisine)=mysql_fetch_array($result)) { $select.="<option value=\"$cuisine\">$cuisine</option>\n"; } $select.="</select>"; } :: Andrew Rush :: Lead Systems Developer :: MaineToday.com :: ************************************************************************** "Crippled but free, blind all the time, i was learning to see" - J. Garcia / R. Hunter ************************************************************************** The views expressed herein are not necessarily those of my employer, but they let me have them anyway. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#6457) next »