i am using email adding program... for my company so in that 1. email should not be same for that i used if(mysql_num_rows(mysql_query("SELECT name FROM appsubmitn WHERE email = '$email'"))){ $msg=$msg."E-Mail already exists. Please try another one<BR>"; $status= "NOTOK";} working 2. email should not be empty.. for this what i have to do please help me, dont say.. if(mysql_num_rows(mysql_query("SELECT email FROM appsubmitn WHERE email = ''"))){ $msg1=$msg1."You must enter email address<BR>"; $status1= "NOTOK";} Why because it was allowing one time empty email into database from second time it will showing the error message.. so what i have to do
I am an ASP coder so I cannot write the correct syntax for the language you use but I would format it this way : ("SELECT email FROM appsubmitn") if [formfield email]="" $msg1=$msg1."You must enter email address<BR>"; $status1= "NOTOK";} First see if the email address is in the db, then reply accordingly. ("SELECT email FROM appsubmitn WHERE email = ''") the query cannot select email if the formfield is empty unless you have another parameter that you can add on what row to search.