hi all,
i am fetching recods from mysql in a combobox.but only one record display .... i want all record display in combobox ......................i write query below and need help how to sote fetch row in array i declered "$va[]"
<?php
// echo "Connected MySql";
$res1 = mysql_query("SELECT gp FROM gp order by gp") or die("Invalid query: " . mysql_query());
//echo ".mysql_query()";
$row=mysql_fetch_array($res1,MYSQL_ASSOC);
$va=array()
$va[] =$row['gp'];/?????????????????????????????????????????????
echo '
<select name="gp" id="gp">';
for($x = 0; $x < count($va); $x++)
{
// write "selected" if the value matches the one posted
if($va[$x] == $_POST['gp'])
{
$selected = 'selected';
}else{
$selected = '';
}
// print the option
echo '
<option value="'.$va[$x].'"'.$selected.'>'.$va[$x].'</option>';
}echo '</select>';
?>