By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,723 Members | 1,876 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,723 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
*** 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

P: n/a
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.