Natcon67
05-11-2005, 12:21 PM
This makes sense but it doesn't work!
I have one mysql_query:
$customers = mysql_query("SELECT custID, company FROM customer ORDER BY company") or die(mysql_error());
I want to populate 3 combo boxes with the same data:
<select name="refCompany">
<option value="">Pick one.....</option>
<?php
while ($row1 = mysql_fetch_object($customers)) {
print "<option value=$row1->custID>$row1->company</option>";
}
?>
</select>
<select name="destCompany">
<option value="">Pick one.....</option>
<?php
while ($row1 = mysql_fetch_object($customers)) {
print "<option value=$row1->custID>$row1->company</option>";
}
?>
</select>
<select name="pickUpCompany">
<option value="">Pick one.....</option>
<?php
while ($row1 = mysql_fetch_object($customers)) {
print "<option value=$row1->custID>$row1->company</option>";
}
?>
</select>
When I do this, only the first combo box is populated. The 2 others are empty.
Thanks,
Nate
I have one mysql_query:
$customers = mysql_query("SELECT custID, company FROM customer ORDER BY company") or die(mysql_error());
I want to populate 3 combo boxes with the same data:
<select name="refCompany">
<option value="">Pick one.....</option>
<?php
while ($row1 = mysql_fetch_object($customers)) {
print "<option value=$row1->custID>$row1->company</option>";
}
?>
</select>
<select name="destCompany">
<option value="">Pick one.....</option>
<?php
while ($row1 = mysql_fetch_object($customers)) {
print "<option value=$row1->custID>$row1->company</option>";
}
?>
</select>
<select name="pickUpCompany">
<option value="">Pick one.....</option>
<?php
while ($row1 = mysql_fetch_object($customers)) {
print "<option value=$row1->custID>$row1->company</option>";
}
?>
</select>
When I do this, only the first combo box is populated. The 2 others are empty.
Thanks,
Nate