Hello!
I am new here. The code and error below I try to solve in three days. Could anyone help me?
$db = new PDO('mysql:dbname=' . DBNAME . ';host=' . DBHOST, DBUSER, DBPASS, array(PDO::ATTR_PERSISTENT => true));
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->exec("INSERT INTO A (phone, city, address) VALUES ('1234567890', 'big city', 'somwhere')");
$db->exec("INSERT INTO B (product, price, email) VALUES ('apple', 50, 'email@localhost')");
The 1st exec is ok but 2nd exec(INSERT INTO B) always get
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'B (product, price, email) VALUES' at line 1
But this statement can execute successfully using MySQL Query Browser. My PHP is 5.3.0 and MySQL is 5.1.30-community.
Thank you!