By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,247 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,247 IT Pros & Developers. It's quick & easy.

MYSQLI experts: mysqli_multi_query generates syntax error

P: 1
I'm using mysqli_multi_query to run multiple queries concatenated with a semicolon that I set using the HEREDOC format.

What's weird is that this works fine on my development system on my laptop (a PC running PHP 5.x and mysql5.x). When I bring the code onto a linux system (with my ISP), the code chokes with a syntax error near the first semicolon. I believe they too are running PHP 5.x and mysql 5.x.

Any clues what's going on? I mean, where just talking about queries like this:

drop table if exists `addressbook`;
CREATE TABLE `addressbook` (`id` int(11) NOT NULL ...

The error is reported near ";CREATE TABLE...." So I'm guessing it has to do with the semicolon and that perhaps somehow, mysql_multi_query is actually being mapped to mysql_query on the ISPs machines? Really, this is weird.

I guess it's not a big deal given than I just broke up the statements, but still, this is annoying. Oh, and just to make sure that there aren't any syntax errors, when I bring up the mysql monitor on the command line and source the multi-line query, everything is fine... it's just something funky about mysqli_multi_query on the ISP.
Nov 27 '06 #1
Share this Question
Share on Google+
1 Reply

Expert 2.5K+
P: 4,258
Thanks for the information. I am not a mysqli user, but is there anyone in the members community who can shed some light on this??

Ronald :cool:
Nov 27 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.