ZT.Ph34rl3ss@gmail.com wrote:
Quote:
Code:
>
<select id="objectTypeSelect" tabindex="2">
<?php
do {
?>
<option value=" <?php echo $row_getObjectTypes['id']?>"><?php echo
$row_getObjectTypes["shortname"] ?></option>
<?php
} while ($row_getObjectTypes = mysql_fetch_assoc($getObjectTypes));
$rows = mysql_num_rows($getObjectTypes);
if($rows 0) {
mysql_data_seek($getObjectTypes, 0);
$row_getObjectTypes = mysql_fetch_assoc($getObjectTypes);
}
?>
</select>
|
Shouldn't you be using a "while {...}" loop rather than a "do {...}
while" loop? You appear to be using $row_getObjectTypes in the echo
before assigning it with mysql_fetch_assoc. Unless you've already done
the mysql_fetch_assoc outside the code shown.
Also, why are you then doing a check if there are any rows in the result
afterwards? Surely, you need to check beforehand so you can prevent an
empty select input?
Robin