-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemailList.php
57 lines (51 loc) · 1.01 KB
/
emailList.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php require_once('common/connect.php');
echo '
<html>
<head>'
?>
<style type="text/css">
#emailTable{
border-collapse:collapse;
}
td, th{
border: 1px solid black;
padding: 5px;
}
</style>
<?php
echo '
</head>
<body>
<h2> Email List Table </h2>
<table id="emailTable">
<tr>
<th>Email List ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
</tr>';
// Display email table
$select = "SELECT * FROM email";
$result = mysqli_query($dbc, $select);
while ($row = mysqli_fetch_assoc($result)){
echo '
<tr>
<td>'.$row['email_id'].'</td>
<td>'.$row['first_name'].'</td>
<td>'.$row['last_name'].'</td>
<td>'.$row['email'].'</td>
</tr>';
}
echo'
<tr></tr>
</table>
</body>
</html>';
// Does email exists on db. Returns boolean True means yes, False means no
function emailExist($email){
global $dbc;
$select = "SELECT email FROM email WHERE email = '$email'";
$result = mysqli_query($dbc,$select);
return (mysqli_num_rows($result) > 0) ? true : false;
}
?>