467,104 Members | 1,042 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,104 developers. It's quick & easy.

how display all the record of a certain field in a combobox

How can I display all the record of a certain field in a combobox after I
have connected to a db in mysql ???
thanks a lot

--

Alberto
Jul 17 '05 #1
  • viewed: 1774
Share:
2 Replies
*** SAN CAZIANO wrote/escribió (Tue, 15 Jun 2004 08:16:43 GMT):
How can I display all the record of a certain field in a combobox after I
have connected to a db in mysql ???


You probably have a loop to get results. Just print them:

echo '<option>' . $value . '</option>';

--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Jul 17 '05 #2
I noticed that Message-ID: <Lf***********************@news3.tin.it> from
SAN CAZIANO contained the following:
How can I display all the record of a certain field in a combobox after I
have connected to a db in mysql ???
thanks a lot

$select="<select size=\"1\" name=\"select_box_name\">;
$sql="SELECT * from table";
$result = mysql_query($sql);
while ($myrow = mysql_fetch_array($result)){
$select.="<option
value=\"".$myrow['field_value']."\">".$myrow['field_description']."</option>\n";
}
$select.="</select>";

print $select;
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Xiphias | last post: by
6 posts views Thread by Bernd Smits | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.