-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetmanualinfo.php
More file actions
51 lines (36 loc) · 1.31 KB
/
getmanualinfo.php
File metadata and controls
51 lines (36 loc) · 1.31 KB
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
<?php
// Get a connection for the database
require_once('../mysqli_connect.php');
// Create a query for the database
$query = "SELECT brand, title, classification , copyrightyear, location FROM equipment_manuals";
// Get a response from the database by sending the connection
// and the query
$response = @mysqli_query($dbc, $query);
// If the query executed properly proceed
if($response){
echo '<table align="left"
cellspacing="5" cellpadding="8">
<tr><td align="left"><b>Brand</b></td>
<td align="left"><b>Title</b></td>
<td align="left"><b>Classification</b></td>
<td align="left"><b>Copyright Year</b></td>
<td align="left"><b>Location</b></td>';
// mysqli_fetch_array will return a row of data from the query
// until no further data is available
while($row = mysqli_fetch_array($response)){
echo '<tr><td align="left">' .
$row['brand'] . '</td><td align="left">' .
$row['title'] . '</td><td align="left">' .
$row['classification'] . '</td><td align="left">' .
$row['copyrightyear'] . '</td><td align="left">' .
$row['location'] . '</td><td align="left">' .
echo '</tr>';
}
echo '</table>';
} else {
echo "Couldn't issue database query<br />";
echo mysqli_error($dbc);
}
// Close connection to the database
mysqli_close($dbc);
?>