summary refs log tree commit diff stats
path: root/includes/functions.php
blob: edb666b32a897d56a0aaf0582fc681caef12f5a5 (plain) (blame)
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
<?php

function has_meta($id, $name)
{
	$getmeta = "SELECT * FROM meta WHERE comic_id = " . $id . " AND name = \"" . $name . "\"";
	$getmeta2 = mysql_query($getmeta);
	$getmeta3 = mysql_fetch_array($getmeta2);

	if ($getmeta3['name'] == $name)
	{
		return true;
	}

	return false;
}

function get_meta($id, $name)
{
	$getmeta = "SELECT * FROM meta WHERE comic_id = " . $id . " AND name = \"" . $name . "\"";
	$getmeta2 = mysql_query($getmeta);
	$getmeta3 = mysql_fetch_array($getmeta2);

	return $getmeta3['value'];	
}

function next_comic_id()
{
	$getcomic = "SELECT * FROM comics WHERE status = \"publish\" ORDER BY comic_id DESC LIMIT 0,1";
	$getcomic2 = mysql_query($getcomic);
	$getcomic3 = mysql_fetch_array($getcomic2);

	return ($getcomic3['comic_id']+1);
}

?>