PDA

View Full Version : Multiple SQL Statements, one DB Call


Trek
06-26-2009, 08:45 PM
So I'm creating one string with multiple INSERT statements in it, separated by a semi-colon. Standard mySQL insert, nothing special at all.

But I keep getting errors that the SQL is bad.

I paste the same SQL into phpMyAdmin, etc.. it works every time.

If call query_write for each SQL statement instead of trying to do 2 or more, it works just fine.

So basically, instead of only doing 1 call to the database, I have to do 20. I'm sure there is a way around this or I'm doing something wrong when it comes to vB, anyone have any ideas?

Dismounted
06-27-2009, 04:56 AM
vBulletin uses mysql_query() or mysqli_query(), depending on the library chosen. This function does not allow multiple queries.