I have a query that I want to check if there are 2 columns with the same data and if so not add data, I will elaborate.
This is my query
INSERT INTO " . TABLE_PREFIX . "installs (
username,userid,email,addontitle,addonversion,bburl,bbtitle,webmasteremail,cookie,dateline
) VALUES (
'$username','$userid','$email','$addontitle','$addonversion','$bburl','$bbtitle','$webmasteremail','$cookie',NOW()
)
I want to check if bburl and addontitle match an entry being submitted and if so not to add that entry. Lets add some example entries
1 --- test@test.com --- Addon --- 1.2 --- test.com --- test --- admin@test.com --- 1 --- ????????
1 --- test@test.com --- Addon2 --- 1.2 --- test.com --- test --- admin@test.com --- 1 --- ????????
1 --- test@test.com --- Addon --- 1.2 --- test2.com --- test --- admin@test.com --- 1 --- ????????
all of these entries would add but now we get another entry:
1 --- test@test.com --- Addon --- 1.3 --- test2.com --- test --- admin@test.com --- 1 --- ????????
test2.com has already installed Addon so I dont want this entry added. How can I prevent this?
As a separate question. If you notice the requested entry I don't want, it seems test2.com was just updating the product, is there a way I can make that modify the existing values and update what has been changed?