Two queries with one mysql_query call? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Two queries with one mysql_query call? (
/showthread.php?tid=567038)
Two queries with one mysql_query call? -
dusk - 10.03.2015
I tried using BlueG plugins R6 and R33.
Both plugins show an error while the same query executes just fine in pMA. What is up with that? The fact that it works in phpMyAdmin tells me that the query syntax is fine.
I tried a simple query:
Код:
SELECT * FROM players; INSERT INTO players(name)VALUES('hi')
R33 error:
pawn Код:
[ERROR] CMySQLQuery::Execute[] - (error #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 'INSERT INTO players(name)VALUES('hi')' at line 1
R6 error:
pawn Код:
CMySQLHandler::Query(SELECT * FROM players INSERT INTO players(name)VALUES('hi');) - An error has occured. (Error ID: 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 'INSERT INTO players(name)VALUES('hi')' at line 1)
Re: Two queries with one mysql_query call? -
Isolated - 10.03.2015
Looks to be as if BlueG removes semicolons inside queries, perhaps escapes the string?
Re: Two queries with one mysql_query call? -
Vince - 10.03.2015
This is not possible as far as I know. If you want to do something else (e.g. auditing) when a query executes, have a look at MySQL triggers.
Re: Two queries with one mysql_query call? -
dusk - 10.03.2015
I actually don't want anything. I'm just interested on WHY doesn't it work?
Re: Two queries with one mysql_query call? -
PowerPC603 - 10.03.2015
BlueG intentionally disabled multiple queries in one query:
http://forum.sa-mp.com/showthread.ph...le#post3121344
Re: Two queries with one mysql_query call? -
dusk - 10.03.2015
Thanks PowerPC603! SQL injections were the reason I wanted to know this in the first place