i don't know what is the expected problem in fetching rows :\ why the result look like this ?
$result=mysql_query($query);
$tbl.="<table id=tblsearch align =center border=0 >
<tr bgcolor=gray>";
$RowNum =mysql_num_fields($result);
//name of field :) ....
for($col=0;$col<$RowNum;$col++)
$tbl.='
<th font color=white>'.
mysql_field_name($result, $col).'</font></th>';
//update/delete OK
$tbl.='
</tr>';
$rownow=1;
while ($row =mysql_fetch_row($result)) { //fetch_row
$tbl.'<tr onmousemove=\"HighLightRow($rownow)\" bgcolor=#eehh99';
if ($rownow%2==0)
$tbl.="#669999>";
else
$tbl.="#66CC99>";
$rownow++;
for($col=0;$col<$RowNum;$col++)
$tbl.='
<td> $row[$col] </td>';
$tbl.='</tr>';
}//while
if(mysql_errno()==0)
return $tbl.'</table>';
else
return "error".mysql_error();
}//function
please don't tell me to use mysqli instead of mysql -_- i will in future i'm a student and To become a master first i must learn to be a student.