Forum Moderators: coopster
$staff_sql="SELECT * FROM users WHERE users_type = 1 ORDER BY users_firstname ASC";
$staff_result = mysql_query($staff_sql) or die(mysql_error());
<table cellpadding="0" cellspacing="0" id="data">
<tr class="redheader">
<th class="w120">Name</th>
<th class="w120">Telephone</th>
<th class="w80">Email</th>
</tr>
<?php while($staffrow=mysql_fetch_array($staff_result)) { ?>
<tr>
<?php
$user_firstname = $staffrow['users_firstname'];
$user_lastname = $staffrow['users_lastname'];
?>
<td><?php echo $user_firstname . " " . $user_lastname;?></td>
<td><?=$staffrow['users_telephone'];?></td>
<?php
$user_email = $staffrow['users_email'];
?>
<td><a href="mailto:<?php echo $user_email; ?>"><?php echo $user_email; ?></a></td>
</tr>
<?php }?>
</table>
<select id="manufacturer_id" name="manufacturer_id" class="w140">
<option selected="selected" value="0">Select A Make</option>
<? while($row=mysql_fetch_array($result1)) { ?>
<option value="<?php echo $row['manufacturer_id']; ?>"><?php echo $row['manufacturer_name']; ?></option>
<? } ?>
</select>
<?php
$mfg_list=null;
// your select statement
$result1 = mysql_query($select) or die("Cannot execute query");
while($row=mysql_fetch_array($result1)) {
$mfg_list .= "<option value=\"" . $row['manufacturer_id'];
if (isset($_POST['manufacturer_id']) and ($_POST['manufacturer_id']==$row['manufacturer_id'])) {
$mfg_list .= ' selected="selected"';
}
$mfg_list .= "\">" . $row['manufacturer_name'] . "</option>\n";
}
if ($mfg_list) {
echo <select id=\"manufacturer_id\" name=\"manufacturer_id\" class=\"w140\">
<option value=\"0\">Select A Make</option>
$mfg_list
</select>
";
}
else { echo "<em>(No manufacturers found)</em>"; }
?>