MySQL Database Php

use this bit of code to create a grid
for($r=1;$r<=$NoRows;$r++){
echo"";
for($c=1;$c<=$NoCols;$c++){
echo"";
echo"";
}
echo"";
}
?>
now put in the database like this
for($i=1;$i<=$NoRows;$i++){
$sql="INSERT INTO RateTable".$TableName." VALUES(".$i;
for($j=1;$j<=$NoCols;$j++){
$sql=$sql.",".($Field["[$i][$j]"]);
}
$sql=$sql.")";
echo"

".$sql."

";
if(!mysql_db_query("wilrus",$sql)){
echo"

Major problem, sorry

";
}else{
echo"

Row ".$i." created.

";
}
}
?>