Re: Compare and inserting with php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/30/09 11:17 AM, "Ashley Sheridan" <ash@xxxxxxxxxxxxxxxxxxxx> wrote:

> It's a bad way of doing it, but could you not create a unique index on the
> particular key you want to be unique, and then just try the select anyway
> with the mysql_query() call preceeded with an @ to suppress warnings?

if you're going that route and your DB supports it, use INSERT IGNORE.

if the primary/unique key makes sense for the application then i don't think
this is all that bad a way of doing things.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux