Re: How to echo something if not exist?
| From: | Miguel J. Jiménez | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: How to echo something if not exist? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175935@lists.php.net to get a copy of this message | ||
Radwan Aladdin wrote:
Hi all.. I want to echo something if the GET value was not exist in the database.. So for example : The user enters his email address and if this email was not found in the field of the email addresses in the table.. then echo "Invalid Email Address" So how to do it? Regards..You must use a select statement to know if it exists or not... kind of: $rs = mysql_query("select email from <table_name> where email='$email'"); if (mysql_num_rows($rs) == 0) // Does not exist else // Does exist