SA-MP Forums Archive
Mysql problem - 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: Mysql problem (/showthread.php?tid=620744)



Mysql problem - Mahesh90901 - 02.11.2016

Hello i am getting bug where the query gets wrongly executed
This is from the save business function
Код:
strcat(iQuery, "UPDATE `BusinessInfo` SET ");
	mysql_format(MySQLPipeline, iFormat, sizeof(iFormat), "`Owner` = '%e', ", BusinessInfo[bid][bOwner]);
and when i saw the the logs its executed like this
Код:
[DEBUG] mysql_tquery - connection: 1, query: "UPDATE `BusinessInfo` SET `Owner` = ' ', `Dupekey` = 'NoBodY', `N", callback: "(null)", format: "(null)"
as you can see the Owner space is blank which is supposed to be Nobody.can any one help me where the problem is thanks.


Re: Mysql problem - NeXoR - 02.11.2016

PHP код:
mysql_format(MySQLPipelineiQuerysizeof(iQuery), "UPDATE `database` SET `Owner` = '%e' WHERE `Owner`='%e'"BusinessInfo[bid][bOwner], CurrentOwner); 
You don't need strcat, format wipes all previous edits, format to "iFormat" will remove everything inside and put what you have typed
Fix current owner and increase iQuery size if needed, good luck.


Re: Mysql problem - Vince - 02.11.2016

I was just staring at my blinking cursor for five full minutes deciding how to respond. But truth is, I don't know how to respond. It simply doesn't work like that. You can't concatenate anything like that. The fourth parameter should be the complete query.