You are here: Re: [PHP] Check for doubleposts « PHP « IT news, forums, messages
Re: [PHP] Check for doubleposts

Posted by Richard Lynch on 10/19/43 11:15

On Tue, May 3, 2005 9:48 am, Fredrik Arild Takle said:
> what is the easiest way to check if a person i registered twice in a
> mysql-table. Lets assume that I only check if the last name is in the
> table
> more than once. This is in mysql 4.0 (subquery not an option).
>
> Do I have to use arrays and in_array. Or is there a more elegant solution?

If the GROUP BY and HAVING solution doesn't thrill you (and I thought it
was quite nice and elegant) you could go with Ye Olde Standard Answer:

select * from user_table as a, user_table as b where a.lastname =
b.lastname and a.user_id != b.user_id

You can use a.user_id < b.user_id to see only the one duplication.

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация