Here is my full SQL query (variable named $query) that I'm echo'ing out right before the actual query:
UPDATE wp_portfolio_items SET caption='This is a caption',item_order=1,image='20130705104136Layer-651.jpg' WHERE id=1; UPDATE wp_portfolio_items SET caption='This is another caption',item_order=2,image='20130705104137photo.JPG' WHERE id=2;
If I copy that query and run it in phpMyAdmin's SQL tab, it runs fine and updates the two rows. However, when this is queried in WordPress it gives this WordPress error:
WordPress database error: [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 'UPDATE wp_portfolio_items SET caption='This is another caption',item_order=2,ima' at line 1]
UPDATE wp_portfolio_items SET caption='This is a caption',item_order=1,image='20130705104136Layer-651.jpg' WHERE id=1; UPDATE wp_portfolio_items SET caption='This is another caption',item_order=2,image='20130705104137photo.JPG' WHERE id=2;
I doubt this is necessary to include, but I'll do it anyways. This is the code where I run the query:
if ($query != "") {
echo $query . "<br><br>";
$wpdb->show_errors();
$wpdb->query($query);
exit;
}
Any ideas why WordPress would have a problem with this query, but phpMyAdmin can run it just fine?