The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hybrid View

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?