summary refs log tree commit diff stats
path: root/includes/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/functions.php')
-rw-r--r--includes/functions.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/includes/functions.php b/includes/functions.php new file mode 100644 index 0000000..edb666b --- /dev/null +++ b/includes/functions.php
@@ -0,0 +1,35 @@
1<?php
2
3function has_meta($id, $name)
4{
5 $getmeta = "SELECT * FROM meta WHERE comic_id = " . $id . " AND name = \"" . $name . "\"";
6 $getmeta2 = mysql_query($getmeta);
7 $getmeta3 = mysql_fetch_array($getmeta2);
8
9 if ($getmeta3['name'] == $name)
10 {
11 return true;
12 }
13
14 return false;
15}
16
17function get_meta($id, $name)
18{
19 $getmeta = "SELECT * FROM meta WHERE comic_id = " . $id . " AND name = \"" . $name . "\"";
20 $getmeta2 = mysql_query($getmeta);
21 $getmeta3 = mysql_fetch_array($getmeta2);
22
23 return $getmeta3['value'];
24}
25
26function next_comic_id()
27{
28 $getcomic = "SELECT * FROM comics WHERE status = \"publish\" ORDER BY comic_id DESC LIMIT 0,1";
29 $getcomic2 = mysql_query($getcomic);
30 $getcomic3 = mysql_fetch_array($getcomic2);
31
32 return ($getcomic3['comic_id']+1);
33}
34
35?>