diff options
Diffstat (limited to 'index.php')
-rwxr-xr-x | index.php | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/index.php b/index.php index a902cce..951e2bb 100755 --- a/index.php +++ b/index.php | |||
@@ -4,16 +4,14 @@ include('db.php'); | |||
4 | 4 | ||
5 | ob_start(); | 5 | ob_start(); |
6 | 6 | ||
7 | $posts = array(); | ||
8 | |||
9 | if (isset($_GET['id'])) | 7 | if (isset($_GET['id'])) |
10 | { | 8 | { |
11 | $getimages = "SELECT * FROM images WHERE id = " . $_GET['id']; | 9 | $getimage = "SELECT * FROM images WHERE id = " . $_GET['id']; |
12 | } else { | 10 | } else { |
13 | $getimages = "SELECT * FROM images ORDER BY id DESC LIMIT 0,1"; | 11 | $getimage = "SELECT * FROM images ORDER BY id DESC LIMIT 0,1"; |
14 | } | 12 | } |
15 | $getimages2 = mysql_query($getimages); | 13 | $getimage2 = mysql_query($getimage); |
16 | $getimage3 = mysql_fetch_array($getimages2); | 14 | $getimage3 = mysql_fetch_array($getimage2); |
17 | 15 | ||
18 | ?> | 16 | ?> |
19 | <DIV CLASS="post"> | 17 | <DIV CLASS="post"> |
@@ -39,8 +37,11 @@ $getimage3 = mysql_fetch_array($getimages2); | |||
39 | <?php | 37 | <?php |
40 | 38 | ||
41 | $id = $getimage3['id']; | 39 | $id = $getimage3['id']; |
42 | $all = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM images")); | 40 | |
43 | $all = $all['COUNT(*)']; | 41 | $cntimages = "SELECT COUNT(*) FROM images"; |
42 | $cntimages2 = mysql_query($cntimages); | ||
43 | $cntimages3 = mysql_fetch_array($cntimages2); | ||
44 | $all = $cntimages3['COUNT(*)']; | ||
44 | 45 | ||
45 | if ($id > 2) | 46 | if ($id > 2) |
46 | { | 47 | { |
@@ -68,10 +69,10 @@ if ($id < $all) | |||
68 | } | 69 | } |
69 | } | 70 | } |
70 | 71 | ||
71 | $getnpending = "SELECT COUNT(*) FROM pending"; | 72 | $cntpending = "SELECT COUNT(*) FROM pending"; |
72 | $getnpending2 = mysql_query($getnpending); | 73 | $cntpending2 = mysql_query($cntpending); |
73 | $getnpending3 = mysql_fetch_array($getnpending2); | 74 | $cntpending3 = mysql_fetch_array($cntpending2); |
74 | $numpending = $getnpending3['COUNT(*)']; | 75 | $numpending = $cntpending3['COUNT(*)']; |
75 | 76 | ||
76 | ?> | 77 | ?> |
77 | </UL> | 78 | </UL> |