SA-MP Forums Archive
UPDATE TAble. - 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: UPDATE TAble. (/showthread.php?tid=480461)



UPDATE TAble. - audriuxxx - 10.12.2013

Hi,

i want to ask.

If i insert something into DB, can i in same time use update? ex:

INSERT INTO players (name) VALUES ('%s')
UPDATE players SET Xp='%d'


Re: UPDATE TAble. - Tayab - 10.12.2013

Yes, you can update after inserting data.


Re: UPDATE TAble. - StuartD - 10.12.2013

If you want to update at the same time, you could just insert it at the same time? Like, (might be wrong, noob at SQL)

INSERT INTO players (name, Xp) VALUES ('%s', '%d')

Then you don't have to run more than one thing


Re: UPDATE TAble. - Loot - 10.12.2013

I believe you can, via a ';' (semicolon) in the query, but I really can't see why it's that necessary.
The INSERT does the job well, use UPDATE whenever you actually need to update the data, not right after inserting new ones.

pawn Код:
INSERT INTO players (name) VALUES ('%s'); UPDATE players SET Xp='%d'