You are here: Re: Duplicate key check « PHP SQL « IT news, forums, messages
Re: Duplicate key check

Posted by NC on 05/20/06 02:53

korndragon@gmail.com wrote:
>
> I'm making a "plug your site" script and I need to check my DB for
> duplicate URLs before adding a new entry.

You don't. Make URL a unique-index field and add keyword IGNORE after
INSERT. This will ensure that no records with the same URL are
created. Alternatively, create an additional field and populate it
with MD5 hash of the URL and index that field rather than the URL.

Cheers,
NC

 

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

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