Re: [PHP] Populating a list box from a database - The code

2002-12-28 Thread Paul Chvostek
I assume you want the array populated with something other than the display name in the , so I've made up "OrgId" as a field name in your database. How 'bout something a little easier to read, using a more consistent style? ... if ($err) print "Database error: " . $err . ""; else {

Re: [PHP] Populating a list box from a database - The code

2002-12-28 Thread John Nichel
;; "PHP general list" <[EMAIL PROTECTED]> Sent: Sunday, December 29, 2002 1:41 AM Subject: Re: [PHP] Populating a list box from a database - The code be carefull with the results of mysql_fetch_array, array names are DB field names, for easier access =) "; while($o

Re: [PHP] Populating a list box from a database - The code

2002-12-28 Thread Denis L. Menezes
little bit more? Thanks denis - Original Message - From: "Maciek Ruckgaber Bielecki" <[EMAIL PROTECTED]> To: "Denis L. Menezes" <[EMAIL PROTECTED]> Cc: "Justin French" <[EMAIL PROTECTED]>; "PHP general list" <[EMAIL PROTECTED]> Se

Re: [PHP] Populating a list box from a database - The code

2002-12-28 Thread John Nichel
$Organisation[1] is always going to be empty because you're only selecting one item per row from the DB SELECT OrgName If you want the same output in both places, just do this... echo ( "$Organisation[0]\n" ); Denis L. Menezes wrote: $link = mysql_connect("localhost","lod

Re: [PHP] Populating a list box from a database - The code

2002-12-28 Thread Maciek Ruckgaber Bielecki
be carefull with the results of mysql_fetch_array, array names are DB field names, for easier access =) "; while($orgData=mysql_fetch_array($result)) { // note that OrgName is the field name in the database. // for value you may use the org_id instead, if you have one in the

[PHP] Populating a list box from a database - The code

2002-12-28 Thread Denis L. Menezes
\n"; } $sql="SELECT OrgName From TableResults ORDER BY OrgName"; $result=mysql_query($sql); While($Organisation=mysql_fetch_array($result)) { Print("$Organisation[1]\n"); } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.

Re: [PHP] Populating a list box from a database

2002-12-28 Thread Justin French
SHOW US SOME CODE!!! none of us are mind readers... either copy a few lines from the HTML source in IE, or from the PHP script. Justin on 29/12/02 4:03 AM, Denis L. Menezes ([EMAIL PROTECTED]) wrote: > Hello Friends, > > Two days ago I had asked how to do this. Thanks for the replies. > > I h

[PHP] Populating a list box from a database

2002-12-28 Thread Denis L. Menezes
Hello Friends, Two days ago I had asked how to do this. Thanks for the replies. I have done the required code and I can see the html output(Under view-> source in the IE browser) and see the option values for the listbox are acheived. But the listbox in the browser is very thin and does not sh