Is it possible to insert a row, but only if one of the values already in the table does not exist?
I'm creating a Tell A Friend with referral points for an ecommerce system, where I need to insert the friend's email into the database table, but only if it doesn't already exist in the table. This is because I don't want any more than 1 person getting the referral points once the new customer signs up and purchases something. Therefore I want only one email ever once in the table.
I know I could do this with 2 queries, but I imagine one of you sharp persons out there could do it in one? I tried but kept getting MySql errors.
Thanks in advance!
Oh and I'm using PHP 4 and MySql 4.1