SA-MP Forums Archive
How do i purge a faction from MYSQL? (( Remove all members on faction from MySQL query )) - 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: How do i purge a faction from MYSQL? (( Remove all members on faction from MySQL query )) (/showthread.php?tid=608522)



How do i purge a faction from MYSQL? (( Remove all members on faction from MySQL query )) - Yasubo - 02.06.2016

How do i purge a faction from MYSQL? (( Remove all members on faction from MySQL query )) .

Is there any way on how to run a SQL query that checks for each Account if his faction=1 then make it faction=0? A big thanks.


Re: How do i purge a faction from MYSQL? (( Remove all members on faction from MySQL query )) - Konstantinos - 02.06.2016

An example would be:
pawn Код:
"UPDATE Accounts SET faction=0 WHERE faction=1;"
Another one could have been Foreign Key Constraints but that would set them to NULL on delete so not recommended.


Re: How do i purge a faction from MYSQL? (( Remove all members on faction from MySQL query )) - Yasubo - 02.06.2016

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
An example would be:
pawn Код:
"UPDATE Accounts SET faction=0 WHERE faction=1;"
Another one could have been Foreign Key Constraints but that would set them to NULL on delete so not recommended.
PHP код:
UPDATE Accounts SET RunLoopThroughAcc WHERE faction=1 SET faction=
Thats right?


Re: How do i purge a faction from MYSQL? (( Remove all members on faction from MySQL query )) - Akbaig - 02.06.2016

He just gave an example, in which