-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumber8.php
More file actions
34 lines (30 loc) · 787 Bytes
/
Number8.php
File metadata and controls
34 lines (30 loc) · 787 Bytes
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
<?php
ini_set ('error_reporting', 1); //Turns on error reporting - remove once everything works.
try{
require_once('/pdo_connect.php'); //Connect to the database which is outside public_html
$sql = 'SELECT Title FROM Genre NATURAL JOIN Movie WHERE Genre LIKE "%horror%";';
$result = $dbc-> query($sql);
} catch (PDOException $e){
echo $e->getMessage();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Find movies that are part of the horror genre </title>
<meta charset ="utf-8">
</head>
<body>
<h2>Find movies that are part of the horror genre </h2>
<table>
<tr>
<th>Movie</th>
</tr>
<?php foreach ($result as $auth) {
echo "<tr>";
echo "<td>".$auth['Title']."</td>";
}
?>
</table>
</body>
</html>