Hey guys,
I am trying to input data into a mysql database from data thats been added by a jquery form with cloned fields. It is working however it adds the first row correctly then a blank row and then the rest of the rows correctly
The code is this
$x=0;
do {
$fga=$_POST['ID'.$x.'fga'];
$fgm=$_POST['ID'.$x.'fgm'];
$fta=$_POST['ID'.$x.'fta'];
$ftm=$_POST['ID'.$x.'ftm'];
$tpa=$_POST['ID'.$x.'tpa'];
$tpm=$_POST['ID'.$x.'tpm'];
$fta=$_POST['ID'.$x.'fta'];
$ftm=$_POST['ID'.$x.'ftm'];
$stl=$_POST['ID'.$x.'stl'];
$trb=$_POST['ID'.$x.'trb'];
$ast=$_POST['ID'.$x.'ast'];
$blka=$_POST['ID'.$x.'blka'];
$blkf=$_POST['ID'.$x.'blkf'];
$tovr=$_POST['ID'.$x.'tovr'];
mysql_query("INSERT INTO stats (gameId, fga, fgm, tpa, tpm, fta, ftm, ast, stl, trb, blka, blkf, tovr) VALUES ('$gameId', '$fga', '$fgm', '$tpa', '$tpm', '$fta', '$ftm', '$ast', '$stl', '$trb', '$blka', '$blkf', '$tovr')")or die("<div class='errmsg'>Insert Error: ".mysql_error()."</div><br /> \n");
$x++;
Can anyone see what ive done wrong?
Thanks