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]
|