dimanche 31 mai 2015

Using a while loop on a query

I have the following query, but my problem is the following:

 $insert_email = "select * from customers";
$run_email = mysqli_query($con, $insert_email);

$find_email = mysqli_fetch_array($run_email);
$demail = $find_email['customer_email'];

echo $demail;

My problem is that at its current state it only returns the first item in this customers table, I would want it to return all of the customer_email in that row and not just the first one.

This is because I would later want to compare it

if($email!= $demail){

where if the email entered by the user during registration is found in the database than I will tell the user the email is already in use by throwing in an else statement.

Aucun commentaire:

Enregistrer un commentaire