I want to insert an imploded array to database..
Example: $array = array('A','B','C')
.. after the implode, the value will be A,B,C
, because I use implode(",",$array)
...
Then I want to insert to database but failed, it said:
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 ') values ('Operation Director','Operation Director','F001')
What should I do?
This is the MySQL query:
$code = $_POST['code'];
$position = $_POST['check'];
$checkok = implode(",",$position);
mysql_query("insert into checklist (check_ok,check_pos,check_code) values ('$checkok','$checkok','$code')") or die (mysql_error());