#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    Toronto,Ontario,Canada
    Posts
    324
    Rep Power
    16
    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.

    Thanks


    Aaron
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    Englewood, CO
    Posts
    30
    Rep Power
    15
    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.

    -TM

    [This message has been edited by TroutMask (edited February 23, 2000).]

Similar Threads

  1. The Soothingly Seamless Setup of Apache, SSL, MySQL, and PHP
    By guest in forum Development Articles
    Replies: 631
    Last Post: January 13th, 2004, 05:41 PM
  2. postgresql installation help
    By lightyears in forum PostgreSQL Help
    Replies: 3
    Last Post: November 2nd, 2003, 07:38 PM
  3. libtool-1.3.4_4 and bash settings
    By wacko_cracko in forum BSD Help
    Replies: 2
    Last Post: May 16th, 2003, 01:30 PM
  4. php installation issues - red hat linux
    By SiFactor in forum Linux Help
    Replies: 3
    Last Post: February 26th, 2003, 10:17 PM
  5. Problems installing KDE Decoration
    By Jestah in forum Linux Help
    Replies: 10
    Last Post: November 7th, 2002, 01:41 PM

IMN logo majestic logo threadwatch logo seochat tools logo