troubleshooting Question

loop through records to check if email exists

Avatar of jonofat
jonofat asked on
15 Comments2 Solutions247 ViewsLast Modified:
I am trying to loop through records once a user types in their email address to see if it exists but I am not quite getting it..

$email = $_POST['email'];
   $query_Recordset1 = "SELECT customeremail FROM customers";
   $Recordset1 = mysql_query($query_Recordset1, $evs) or die(mysql_error());
   while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)){;
   $totalRows_Recordset1 = mysql_num_rows($Recordset1);
   if ( $email == $row_Recordset1['customeremail'] ) {
	echo "That email exists";
} else {
	echo "That email doesn't exist";

Open in new window

Greg Alexander
Lead Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 15 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros