4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Multi Checking
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Iyonix
WebHelper
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England

PostPosted: Sat Mar 22, 2003 9:57 am (14 years, 8 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by IyonixSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sat Mar 22, 2003 12:20 pm (14 years, 8 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Iyonix
WebHelper
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England

PostPosted: Sat Mar 22, 2003 1:21 pm (14 years, 8 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by IyonixSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Sat Mar 22, 2003 3:36 pm (14 years, 8 months ago) Reply with QuoteBack to Top

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...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
drathbun
WebHelper
WebHelper


Joined: 01 Mar 2003
Posts: 69
Location: Texas

PostPosted: Sat Mar 22, 2003 8:40 pm (14 years, 8 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by drathbunSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




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.050713 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme