MYSQL Right syntax for this
#2

A subquery needs to be a full fledged query.

PHP Code:
UPDATE `player_inventory` SET `amount` = `amount` + (SELECT `amount` FROM player_inventory WHERE `id` = %d) WHERE `id` = %d 
And oh, don't use quotes around integer values. It prevents indexes from being used which will needlessly slow down your queries.
Reply


Messages In This Thread
MYSQL Right syntax for this - by Skream - 14.09.2017, 14:47
Re: MYSQL Right syntax for this - by Vince - 14.09.2017, 15:09
Re: MYSQL Right syntax for this - by Skream - 14.09.2017, 15:57
Re: MYSQL Right syntax for this - by Vince - 14.09.2017, 16:15
Re: MYSQL Right syntax for this - by Skream - 14.09.2017, 16:26
Re: MYSQL Right syntax for this - by Vince - 14.09.2017, 16:47
Re: MYSQL Right syntax for this - by Skream - 14.09.2017, 16:52

Forum Jump:


Users browsing this thread: 1 Guest(s)