summary refs log tree commit diff stats
path: root/pages/comic.php
diff options
context:
space:
mode:
Diffstat (limited to 'pages/comic.php')
-rwxr-xr-xpages/comic.php22
1 files changed, 12 insertions, 10 deletions
diff --git a/pages/comic.php b/pages/comic.php index 620a038..53b0538 100755 --- a/pages/comic.php +++ b/pages/comic.php
@@ -2,12 +2,16 @@
2 2
3if (isset($_GET['id']) && is_numeric($_GET['id'])) 3if (isset($_GET['id']) && is_numeric($_GET['id']))
4{ 4{
5 $getcomic = "SELECT * FROM comics WHERE comic_id = " . $_GET['id'] . " AND status = \"publish\""; 5 $getcomic = $mysql_conn->prepare("SELECT * FROM comics WHERE comic_id = ? AND status = \"publish\"");
6 $comic_id = $_GET['id'];
7 $getcomic->bind_param("i", $comic_id);
8 $getcomic->execute();
9 $getcomic2 = $getcomic->get_result();
10 $getcomic3 = $getcomic2->fetch_assoc();
6} else { 11} else {
7 $getcomic = "SELECT * FROM comics WHERE status = \"publish\" ORDER BY comic_id DESC LIMIT 0,1"; 12 $getcomic = $mysql_conn->query("SELECT * FROM comics WHERE status = \"publish\" ORDER BY comic_id DESC LIMIT 0,1");
13 $getcomic3 = $getcomic->fetch_assoc();
8} 14}
9$getcomic2 = mysql_query($getcomic);
10$getcomic3 = mysql_fetch_array($getcomic2);
11 15
12$date = strtotime(get_meta($getcomic3['id'], 'pubDate')); 16$date = strtotime(get_meta($getcomic3['id'], 'pubDate'));
13 17
@@ -64,9 +68,8 @@ if (has_meta($getcomic3['id'], 'link'))
64 68
65$id = $getcomic3['comic_id']; 69$id = $getcomic3['comic_id'];
66 70
67$cntcomics = "SELECT COUNT(*) FROM comics WHERE status = \"publish\""; 71$cntcomics = $mysql_conn->query("SELECT COUNT(*) FROM comics WHERE status = \"publish\"");
68$cntcomics2 = mysql_query($cntcomics); 72$cntcomics3 = $cntcomics->fetch_assoc();
69$cntcomics3 = mysql_fetch_array($cntcomics2);
70$all = $cntcomics3['COUNT(*)']; 73$all = $cntcomics3['COUNT(*)'];
71 74
72if ($id > 2) 75if ($id > 2)
@@ -98,9 +101,8 @@ if ($id < $all)
98 } 101 }
99} 102}
100 103
101$cntpending = "SELECT COUNT(*) FROM comics WHERE status = \"pending\""; 104$cntpending = $mysql_conn->query("SELECT COUNT(*) FROM comics WHERE status = \"pending\"");
102$cntpending2 = mysql_query($cntpending); 105$cntpending3 = $cntpending->fetch_assoc();
103$cntpending3 = mysql_fetch_array($cntpending2);
104$numpending = $cntpending3['COUNT(*)']; 106$numpending = $cntpending3['COUNT(*)'];
105 107
106?> 108?>