Forum Moderators: coopster
I have this query:
mysql_select_db($database_BBAddict, $BBAddict);
$query_rsModels = "SELECT id, Type, Name, img FROM bb_data ORDER BY Type DESC";
$rsModels = mysql_query($query_rsModels, $BBAddict) or die(mysql_error());
$row_rsModels = mysql_fetch_assoc($rsModels);
$totalRows_rsModels = mysql_num_rows($rsModels);
on two different pages, which feeds this form:
<form id="form3">
<select name="menu3" id="textfield1" onchange="MM_jumpMenu('parent',this,0)">
<option value="">please choose...</option>
<?php do {?>
<option value="Model.php?id=<?php echo $row_rsModels['id']?>"><?php echo $row_rsModels['Type']?></option>
<?php
} while ($row_rsModels = mysql_fetch_assoc($rsModels));
$rows = mysql_num_rows($rsModels);
if($rows > 0) {
mysql_data_seek($rsModels, 0);
$row_rsModels = mysql_fetch_assoc($rsModels);
}?>
</select>
</form>
The code is identical on both pages, however the drop down list is only populated with parameters from the db on one... anyone have any idea what causes this?
...
$row_rsModels = mysql_fetch_assoc($rsModels);
$totalRows_rsModels = mysql_num_rows($rsModels);
You had the above and again you tried to use it in the while loop.
php.net on mysql_fetch_assoc
Returns an associative array that corresponds to the fetched row and moves the internal data pointer ahead.
That is a bit of a logical reason I could find out.
Whatever it was, it seems you have moved forward.
Habtom