Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
34 views3 pages

Home Activity User With Same Email

This PHP script connects to a MySQL database called "testdb" and runs a query to select all users from the "users" table that have duplicate emails associated with multiple accounts. It displays the results in an HTML table with the user name, email, CNIC, phone number, and comments for any users found to have non-unique emails.

Uploaded by

Ar. Raja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views3 pages

Home Activity User With Same Email

This PHP script connects to a MySQL database called "testdb" and runs a query to select all users from the "users" table that have duplicate emails associated with multiple accounts. It displays the results in an HTML table with the user name, email, CNIC, phone number, and comments for any users found to have non-unique emails.

Uploaded by

Ar. Raja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Home Activity

User with same email


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
$connection=mysqli_connect("localhost","root","","testdb");
if (!$connection) {
die("Connection failed: " . mysqli_connect_error());
}
$query="SELECT *
FROM `users`WHERE user_Email in (SELECT user_Email from users group by user_Email having
count(*) > 1) ";
$result = mysqli_query($connection,$query);
if(mysqli_num_rows($result)>0)
{
?>
<table border="1">
<tr>
<th>
User Name
</th>
<th>
User Email
</th>
<th>
User CNIC
</th>
<th>
User Phone No.
</th>
<th>
User Commetns
</th>
<th>
User Image
</th>
</tr>
<?php
while($row=mysqli_fetch_array($result))
{
?>
<tr>
<td>
<?php echo $row[1]; ?>
</td>
<td>
<?php echo $row[2]; ?>
</td>
<td>
<?php echo $row[3]; ?>
</td>
<td>
<?php echo $row[4]; ?>
</td>
<td>
<?php echo $row[5]; ?>
</td>

</tr>
<?php
}
}
?>
</table>
</body>
</html>

You might also like