Scenario: I am tracking/saving search referrer data including the search $terms and their resulting $url from my site, each in their own column.
I DO want to add an entry even if the $terms OR the $url are already in the database but NOT if an entry has both already. If the referrer data $terms and $url match a previous entry I'd like to either not add a new entry OR increase the count on the previous entry, whichever is easier.
For the sake of simple how would you not insert a new entry if $terms AND $url are in a previous entry?
mysql_query("INSERT IGNORE INTO tablename (term, url)VALUES ('$terms', '$url');")