Re: Populating a from a database

2004-06-26 Thread Frank Bax
Might I suggest separating the mysql calls and html code into separate functions by storing selections in an array first. Then you can more easily manipulate the array for 'none' between the two function calls. The function generating html code could then be called with data not originating f

RE: Populating a from a database

2004-06-26 Thread electroteque
here is how i would do it, a slight change to the if else .. function filelist($fileID) { $result=mysql_query("SELECT ID,title,type FROM files"); echo ""; echo "---NONE---"; if (mysql_num_rows($result)==0) { //no files } else { while ($row=mysql_fetch_array($result)) { $ID=$row["ID"]

Re: Populating a from a database

2004-06-26 Thread Andrew Pattison
I use this method also, but I usually put a --NONE-- item in at the top of the listbox so the user has the option of selecting none of the items in the list. This may or may not be required for your application. Also, you can get the select box to automatically have the value that the a given fiel