SA-MP Forums Archive
Delete all Non RP names from mySQL - 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: Delete all Non RP names from mySQL (/showthread.php?tid=470899)



Delete all Non RP names from mySQL - BizzyD - 20.10.2013

Hello, I was just wondering if there is a quick and easy way to remove all non rp names from the mysql database?
For example, delete everyone who hasnt a "_" in their name


Re: Delete all Non RP names from mySQL - iZN - 20.10.2013

This should work.

Код:
DELETE FROM table_name IGNORE _
EDIT: Might not, I will edit it when I'll get the solution.


Re: Delete all Non RP names from mySQL - Smally - 20.10.2013

If you are doing it with phpMyAdmin then execute this query:

SELECT * FROM tblName WHERE tblName.NameField NOT LIKE '%_%';


Re: Delete all Non RP names from mySQL - BizzyD - 20.10.2013

Yea I am doing it from phpmyadmin smally Will try that, thanks


Re: Delete all Non RP names from mySQL - Smally - 20.10.2013

Take a backup first, dude.


Re: Delete all Non RP names from mySQL - BizzyD - 20.10.2013

I wont try it on the main database ofc :P


Re: Delete all Non RP names from mySQL - Misiur - 20.10.2013

Quote:

DELETE FROM users WHERE id IN (
SELECT * FROM (
SELECT id FROM users WHERE name NOT LIKE '%\_%' GROUP BY id
) AS u
)

Single query which matches all nonrp names (double subselect is due to mysql restrictions when deleting stuff)


Re: Delete all Non RP names from mySQL - BizzyD - 20.10.2013

I tried both of yours. They both returned 0


Re: Delete all Non RP names from mySQL - Smally - 20.10.2013

Did you change the query to match your table name and username etc?


Re: Delete all Non RP names from mySQL - BizzyD - 20.10.2013

yea I did