Mysql problem
#1

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.
Reply
#2

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.
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)