February 23rd, 2000, 03:34 PM
Hi everyone, I need a bit of help with something and being new to PHP I am a little lost.
I have a website that is about to go live in a couple months.
I have a form that allows people to enter their email address to be notified when the site is launched.
I want to be able to parse the mysql database (that I have setup to store the addresses) to check for duplicates of the email address.
If the addresses is not in the dbase then go ahead and store it, otherwise send them to a page that tells them their email addresses has already been entered.
ANY help would be greatly appreciated.
February 23rd, 2000, 03:46 PM
Grab the email address then perform a query on your database:
Say you put the email address into the variable $eAddress,
SELECT COUNT(*) FROM your_table WHERE email_address LIKE '$eAddress'
This will do a case-insensitive search for the email string.
If the count = 0 then enter it into the database, otherwise print your error message.
[This message has been edited by TroutMask (edited February 23, 2000).]