Re: question on listbox.

From: Date: Sat, 01 Feb 2003 12:40:58 +0000
Subject: Re: question on listbox.
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-133873@lists.php.net to get a copy of this message
Thanks Jason. Looks like I am too dumb. I still cannot do it. can u please help me further? Thanks Denis ----- Original Message ----- From: "Jason Wong" <php-general@gremlins.biz> To: <php-general@lists.php.net> Sent: Saturday, February 01, 2003 8:21 PM Subject: Re: [PHP] question on listbox. > On Saturday 01 February 2003 19:08, Denis L. Menezes wrote: > > Hello friends. > > > > I have a listbox which I populate from a query with the database. It is > > working fine. But additinally, I want the first item to be "Select > > category". Can someone please help me how to modify by below written code > > to do the above? > > > > My code : Quote : > > > > > > <?php > > //connecting to the database > > $link = mysql_connect("localhost","MyDomain","MyPass"); > > if ($link){ > > Print ""; > > } else { > > Print "No connection to the database"; > > } > > if (!mysql_select_db("MyDomain_com")){ > > Print "Couldn't connect database"; > > } else { > > Print ""."<br>\n"; > > } > > echo "<option ..."; > > > $sql="SELECT DISTINCT CategoryName From Categories ORDER BY CategoryName"; > > $result=mysql_query($sql); > > > > While($Category=mysql_fetch_array($result)) > > { > > Print("<OPTION VALUE=\"$Category[0]\">$Category[0]\n"); > > } > > > > ?> > > > > Unquote > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > ------------------------------------------ > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > ------------------------------------------ > /* > If you are good, you will be assigned all the work. If you are real > good, you will get out of it. > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#133873) next »