-
Notifications
You must be signed in to change notification settings - Fork 0
/
index1.php
48 lines (44 loc) · 1.09 KB
/
index1.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
<!DOCTYPE html>
<html>
<body>
<?php
// Get access to MySQL Class
require_once(dirname(__FILE__).'/MySQL.class.php');
// Get MySQL connection
$conn = new MySQL('127.0.0.1','peoplecolour','root','ilovetocode');
// Get Rows
$query = 'select firstname,lastname,email,dob,fav_colours from people';
$rows = $conn->getRows($query);
/**
print "<pre>";
print_r($rows);
print "</pre>";
**/
?>
<!-- Create our Table -->
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td>
<font face="Arial, Helvetica, sans-serif">First Name</font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Last Name</font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Email</font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Date of Birth</font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Favourite Colours</font>
</td>
</tr>
<?php
foreach ($rows as $value) {
echo "<tr><td>".$value['firstname']."</td><td>".$value['lastname']."</td><td>".$value['email']."</td><td>".$value['dob']."</td><td>".$value['fav_colours']."</td></tr>";
}
?>
</table>
</body>
</html>