-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview-entries.php
More file actions
67 lines (43 loc) · 1.34 KB
/
view-entries.php
File metadata and controls
67 lines (43 loc) · 1.34 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html>
<head>
<?php include("inc/meta.php"); ?>
<Title>
<?php include("inc/page-index.php"); ?>
</Title>
<?php include("inc/stylesheet.php"); ?>
<?php include("inc/head.php"); ?>
</head>
<body>
<?php include("inc/background-image.php"); ?>
<div id="container">
<?php include("inc/header.php"); ?>
<?php include("inc/widemenu.php"); ?>
<?php include("inc/sidebar-left.php"); ?>
<div id="content">
<?php include("inc/plugin01.php"); ?>
<?php //
/* This script retrieves entries from the database. */
include("admin/mysql-connect.php"); // Connect to MySQL
// Define the query.
$query = "SELECT entry_id, title FROM blog";
// Run the query
if ($r = mysql_query($query, $dbc)) {
// Process & print each record
while ($row = mysql_fetch_array($r)) {
print "<a href=\"page.php?id={$row['entry_id']}\"><h3>{$row['title']}</h3></a><hr />";
}
// End of process & print
} else { // Couldn't get the information.
print '<p style="color: red;">Could not retrieve the entry because:<br />' . mysql_error($dbc) . '.</p><p>The query being run was: ' . $query . '</p>';
}
mysql_close($dbc); // Close the connection.
?>
<?php include("inc/plugin02.php"); ?>
</div>
<?php include("inc/sidebar-right.php"); ?>
<?php include("inc/footer.php"); ?>
</div>
<?php include("inc/scripts.php"); ?>
</body>
</html>