SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    E-business guru Eirik's Avatar
    Join Date
    Nov 2000
    Location
    Oslo, Norway
    Posts
    413
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I'm writing a mailing list management system and I've hit a bump. When the visitor provides an Email address to be removed, I want to display an error message if the Email address provided doesn't exist in the list. The Email address is passed in the "Email" variable, and so I tried doing something like this:

    Code:
    if (!mysql_query("DELETE FROM Subscriber WHERE Email LIKE '$Email'")) {
    echo("The Email address you provided does not exist in the database. Please go back and try again.");
    exit();
    }
    This code however, never returns the error message. I'm assuming this is because the delete command is successful even though the Email address doesn't exist in the list. So what would I say to get a response when the Email address doesn't exist?

    Thanks in advance !
    Sincerely,

    Eirik Johansen
    Netmaking AS

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Location
    Rawalpindi, Pakistan
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try mysql_affected_rows() ......

    Aatif Malik

  3. #3
    E-business guru Eirik's Avatar
    Join Date
    Nov 2000
    Location
    Oslo, Norway
    Posts
    413
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Aatif,

    Thanks! It worked like a charm.
    Sincerely,

    Eirik Johansen
    Netmaking AS


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •