SA-MP Forums Archive
MySQL Query(or something) - 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: MySQL Query(or something) (/showthread.php?tid=465052)



MySQL Query(or something) - No Fear - 20.09.2013

Hi, is there any posible way to do in PAWN. or PHP. To make a huge loop throw MySQL "profiles" tables and find every user that got "test" as "1" and just set it to 0? That means if 1000 users of 100000 has "test" set as 1 Query would set it to 0 for all 1000. Thanks


Re: MySQL Query(or something) - XcorelloX - 20.09.2013

pawn Код:
UPDATE profiles SET `Test` = '0'



Re: MySQL Query(or something) - No Fear - 20.09.2013

How can i make this FOR EVERY user in the MySQL table.


Re: MySQL Query(or something) - IstuntmanI - 21.09.2013

Quote:
Originally Posted by No Fear
Посмотреть сообщение
How can i make this FOR EVERY user in the MySQL table.
pawn Код:
UPDATE profiles SET `Test` = 0
is already for all users in table, because there's no WHERE clause, if it would be for a single user (example: user ID 0) it would be like
pawn Код:
UPDATE profiles SET `Test` = 0 WHERE `ID` = 0



Re: MySQL Query(or something) - No Fear - 21.09.2013

Okay, okay, and what if i would like to take "Test" and transfer that "data" to "Test2" for example if player 0 has Test1 = 154, the system would transfer 154 to Test2. And if player 2 has "Test1 = 464, it would transfer that 464 to "Test2", is it hard to make this?


Re: MySQL Query(or something) - IstuntmanI - 21.09.2013

pawn Код:
UPDATE profiles SET `Test2` = `Test1`, `Test1` = NewValue
I think this is what you want.