|
Author |
Message |
Iyonix
WebHelper
![WebHelper WebHelper](images/rank_2.gif)
![](images/avatars/gallery/computers/risc_os_cogwheels_small.gif)
Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England
|
Posted:
Sat Mar 22, 2003 9:57 am (21 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
I have an online game with user details stored in a database. I want to check for multiple accounts under one email address and delete them as users are only allowed one account on the game. How would I scan the mySQL database looking for more than one occurance of the same email address? |
________________________________ Iyonix |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Iyonix Find all posts by Iyonix](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
Daniel
Team Member
![](images/rank_6.gif)
![](http://www.4webhelp.net/forums/images/daniel_avatar.php)
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sat Mar 22, 2003 12:20 pm (21 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Why don't you set the email column as UNIQUE? Wouldn't that be easier?
Also, shouldn't you just stop these users from signing up, instead of deleting them afterwards? |
________________________________
![Image Image](http://www.4webhelp.net/images/daniel_sig.gif) |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Daniel Find all posts by Daniel](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
Iyonix
WebHelper
![WebHelper WebHelper](images/rank_2.gif)
![](images/avatars/gallery/computers/risc_os_cogwheels_small.gif)
Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England
|
Posted:
Sat Mar 22, 2003 1:21 pm (21 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
There are reasons I don't want to do it like that, but I won't go into them. Is what I am wanting to do possible? |
________________________________ Iyonix |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Iyonix Find all posts by Iyonix](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
adam
Forum Moderator & Developer
![](images/rank_6.gif)
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Sat Mar 22, 2003 3:36 pm (21 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
you could use a while loop to go through all the rows in the table and keep a count of the number of each email address. |
________________________________ It's turtles all the way down... |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by adam Find all posts by adam](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
drathbun
WebHelper
![WebHelper WebHelper](images/rank_2.gif)
Joined: 01 Mar 2003
Posts: 69
Location: Texas
|
Posted:
Sat Mar 22, 2003 8:40 pm (21 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Here's what you need to identify email addresses that have been used more than once. Then you can use this list to process your users...
Code: | select user_email, count(*) as email_count
from phpbb_users
group by user_email
having email_count > 1 |
|
________________________________ Dave
Photography Site :: Query Tools Forum :: Weekend Fun |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by drathbun Find all posts by drathbun](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.151928 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |