Hi all ;
please help me what is the expected problem in this code ??!
function SearchGrid($query,$updateOk=FALSE,$DeleteOk=FALSE)
{
$tbl.="<script>
var prev=1;
function HighLightRow(rowno){
if (rowno%2==0)
tblsearch.rows[prev].bgcolor='#66FF99';
else
tblsearch.rows[prev].bgcolor='#CCCC99';
tblsearch.rows[rowno].bgcolor='white';
prev=rowno;
}
</script> ";
$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.='\n <th font color=white>'.
mysql_field_name($result, $col).'</font></th>';
//update/delete OK
$tbl.='\n </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.='\n <td> $row[$col] </td>';
$tbl.='</tr>';
}//while
if(mysql_errno()==0)
return $tbl.'</table>';
else
return "error".mysql_error();
}//function