Re: Need to send a variable to part of a MySql query

From: Date: Fri, 05 Jan 2001 02:11:53 +0000
Subject: Re: Need to send a variable to part of a MySql query
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-5610@lists.php.net to get a copy of this message
Why not in your query select distinct. "select distinct town from places"... -Jim ----- Original Message ----- From: "Dave Carrera" <dave@davecarrera.com> To: <php-db@lists.php.net> Sent: Thursday, January 04, 2001 12:31 PM Subject: [PHP-DB] Need to send a variable to part of a MySql query > Hi All > Thanks JB for the link to get info about creating a dropdown list populated > with the contents of a field in my DB. > > Now I need to send the selected item from the dropdown list created to a > query. > > In other words my visitor selects lets say London from my created list and > London is then included in a query to select all from my table that inc > London. > > In my db the town name is a must have field but my created list show ALL > instances of the town name, so my dropdown list looks something like this.. > > Choose a town > London > London > London > Cardiff > Dover > Dover > > What I would like to know is how I can just show 1 instance of a towns name > if multiple exist in my db so the list looks like this... > > Choose a town > London > Cardiff > Dover > > Names used only for demonstration... > > Any pointers or direct help with this is most appreciated. > > Dave ;-) > > > -- > 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 (#5610) next »