Question about mysql query
#1

Well for each
pawn Код:
format(query,sizeof(query),"UPDATE...
do i need to have mysql_query, so something like this (this is a example)
pawn Код:
format(query,sizeof(query),"UPDATE accounts SET AdminLevel = %d,Vip = %d WHERE Name = '%s'",PlayerAdmin,PlayerVIP,PlayerName);
mysql_query(query);
format(query,sizeof(query),"UPDATE accounts SET Cash = %d WHERE Name = '%s'",PlayerCash,PlayerName);
mysql_query(query);
or i can do this
2.
pawn Код:
format(query,sizeof(query),"UPDATE accounts SET AdminLevel = %d,Vip = %d WHERE Name = '%s'",PlayerAdmin,PlayerVIP,PlayerName);
format(query,sizeof(query),"UPDATE accounts SET Cash = %d WHERE NAME = '%s'",PlayerCash,PlayerName);
mysql_query(query);
Reply
#2

When formatting, you override the past data with the new data .. So you need to mysql_query after every one.
Reply
#3

I can't see why wouldn't you do all in one line?
pawn Код:
format(query, sizeof(query), "UPDATE accounts SET AdminLevel = %d, Vip = %d, Cash = %d WHERE Name = '%s'", PlayerAdmin, PlayerVIP, PlayerCash, PlayerName);
mysql_query(query);
Reply
#4

Quote:
Originally Posted by Toreno
Посмотреть сообщение
I can't see why wouldn't you do all in one line?
pawn Код:
format(query, sizeof(query), "UPDATE accounts SET AdminLevel = %d, Vip = %d, Cash = %d WHERE Name = '%s'", PlayerAdmin, PlayerVIP, PlayerCash, PlayerName);
mysql_query(query);
I said its a example -_-, did you even read the sentences. I was only asking a question
Reply
#5

I did, yet it's useless. You can only do the first method.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)