MySQL Forums
Forum List  »  Newbie

Proper syntax for multiple query string
Posted by: Ivan D
Date: May 25, 2005 12:42AM

I'm trying to send 2 or more queries to a mysql db from my php code, but It keeps saying i have a syntax error. But if I try the same set of queries from PHPMyAdmin it works.

example:
$query = "INSERT INTO gallery(id) SELECT id FROM gallery_rcl;";
$query .= "DELETE FROM gallery_rcl LIMIT 1";

this gives me an SQL syntax error just after the semicolon, but the same query will work fine if i run it from phpmyadmin's run sql query/quries page.

What's wrong? I really don't want to run each query individually.

Thanks in advance.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.