UPDATE TAble.
#1

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

Yes, you can update after inserting data.
Reply
#3

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
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)