Code: Select all
$values = array();
for($i = 0; $i < $qty; $i++) {
$values[] = "(null,'$postion','$qty','$postion','$join','Inline')"; // create one line for INSERT
}
if(count($values) > 0) {
$values = implode(',', $values); // make full line for INSERT
}
$query=mysql_query("INSERT into line(id,pid,qty,spent_amt,date,status)VALUES".$values)or die(mysql_error());
unset($values); // some cleanup
the INSERT into line is the problem however its reverting back to VALUESARRAY as the error so the array isnt being read or something.
This is the error I get
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUESArray' at line 1
Any ideas would help out.