[PHP] How to echo something if not exist?

2004-01-27 Thread Radwan Aladdin
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..


Re: [PHP] How to echo something if not exist?

2004-01-27 Thread Miguel J. Jimnez
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



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php