$i=0;
$counter=1;
// need to have carID as value in option tag with Rank as counter
while($i<=$numresults)
{
foreach($array as $key => $value )
{
$i++;
//echo "KEY $key<br>";
$dbQuery="SELECT * FROM cars where carID='$key'";
$result = mysql_query($dbQuery,$db);
$carInfo=mysql_fetch_array($result);
$carID=$carInfo["carID"];
echo " <OPTION VALUE=\"$key\">$counter\n";
$counter++;
break;
}
$shifted_element = array_shift ($array);
}
This is giving me ...
<table class=border align=center cellspacing=0 cellpadding=5>
<tr>
<td>I want cars like</td>
<td>
<select name=rank[]>
<option SELECTED>Rank
<OPTION VALUE="48">1
<OPTION VALUE="0">2
<OPTION VALUE="0">3
<OPTION VALUE="0">4
<OPTION VALUE="0">5
<OPTION VALUE="0">6
</select>
but the value for option 2 should be the second index on the array which is 63 in my array.
Can anyone help?