problem with Array
Posted: Mon Apr 30, 2012 8:24 am
A while back i had this code done for me and now its giving me trouble. nothing has been changed and nothing added. but its notgetting the array anymore. I hope someone can help me out
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.
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.