Jump to content

If/else problem


sudsy1970

Recommended Posts

hi all,

 

am trying to write a forgotuser email php script.  Basically the email is entered and if it is in the DB then a function of mail_username is called if no email address then an error message for now ( want to redirect and give an error ????)

 

Only trouble is no emails are being recoginsed, can someone help me out please ?

 

$email = ($_POST['email']);
    $sql = "SELECT user FROM user WHERE email= '$Email'";

  $queryResult=mysql_query($sql);
  $dbRecord=mysql_fetch_array($queryResult);



   # If an email address has been provided by the customer, email the Username to it

   if (mysql_num_rows($queryResult)==0) {

        echo "Not a recognised email address";
   }
   else {
   	  mail_username();
   }

Link to comment
https://forums.phpfreaks.com/topic/205462-ifelse-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.