> <select name="device">
> <?php
> $query ="SELECT DISTINCT device FROM 3backup ORDER BY device";
> $rs =mysql_query($query);
$rs is now the result set for your SQL.
> $device = mysql_result($rs, 'device');
This is wrong. Check the manual page for how you use mysql_result.
http://www.php.net/mysql-result
> while($row = mysql_fetch_object($rs)){
> echo '<option value="';
> echo $device;
> echo '">';
> echo $device;
> echo '</option>\n';
> }
This is odd. Having pulled out the device (or tried to), you're now creating
an object and then not using it.
Try this:
<select name="device">
<?php
$query = "SELECT DISTINCT device FROM 3backup ORDER BY device";
$rs = mysql_query($query);
while($row = mysql_fetch_row($rs))
{
echo '<option value="'.$row[device].'">'.$row[device].'</option>\n';
}
?>
</select>
Now, in order for this to produce more than one option in the
dropdown box, you have to be sure that your SELECT DISTINCT does
in fact return more than one row.
Jason
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]