Raised This Month: $51 Target: $400
 12% 

[SQL]Is this sql query executeable?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gilmon
Senior Member
Join Date: Feb 2011
Location: China
Old 02-10-2015 , 08:16   [SQL]Is this sql query executeable?
Reply With Quote #1

It's work in mysql tools but seem don't work on my sourcemod plugin, thanks.

Code:
update pdate1 += 1, pdata2 += %i where steamid = "STEAM_1:1:1111111"
PHP Code:
decl String:query[105];
Format(query,sizeof(query), "update pdate1 += 1, pdata2 += %i where steamid = '%s'"ctmDataSteamID);
SendSQLUpdate(query); 
gilmon is offline
Send a message via MSN to gilmon
Mehis
Senior Member
Join Date: Mar 2013
Location: basement
Old 02-10-2015 , 09:21   Re: [SQL]Is this sql query executeable?
Reply With Quote #2

You'll have to specify the table.

Something like this:
PHP Code:
UPDATE tablename SET pdata1 pdata1 1pdata2 pdata2 + %i WHERE steamid '%s' 
Mehis is offline
gilmon
Senior Member
Join Date: Feb 2011
Location: China
Old 02-10-2015 , 10:05   Re: [SQL]Is this sql query executeable?
Reply With Quote #3

Quote:
Originally Posted by Mehis View Post
You'll have to specify the table.

Something like this:
PHP Code:
UPDATE tablename SET pdata1 pdata1 1pdata2 pdata2 + %i WHERE steamid '%s' 
Yeah i know that just paste something wrong here, the problem is not there.

Last edited by gilmon; 02-10-2015 at 10:05.
gilmon is offline
Send a message via MSN to gilmon
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 02-10-2015 , 21:30   Re: [SQL]Is this sql query executeable?
Reply With Quote #4

Quote:
Originally Posted by gilmon View Post
Yeah i know that just paste something wrong here, the problem is not there.
exact error from sql natives(or threaded callback error param)
__________________
WildCard65 is offline
JoB2C
AlliedModders Donor
Join Date: Jan 2014
Location: France
Old 02-10-2015 , 21:42   Re: [SQL]Is this sql query executeable?
Reply With Quote #5

The semicolon at the end of the command is maybe required.
JoB2C is offline
h3bus
AlliedModders Donor
Join Date: Nov 2013
Old 02-11-2015 , 07:24   Re: [SQL]Is this sql query executeable?
Reply With Quote #6

I think mySQL does not support the '+=' operator.
The request gilmon gave you is correct.

If not, having the reported mySQL error would help!
h3bus is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:57.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode