summary refs log tree commit diff stats
path: root/index.php
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2009-02-21 10:55:14 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2009-02-21 10:55:14 -0500
commit8abb1350371177d2f001e0aea82c3cc703759918 (patch)
tree36e2975a906a17545c2bf786e7a18c6c28f78559 /index.php
parent0cffae949ce7a7979a76582fd5b1e19f6c192d8b (diff)
downloadpillowcase-8abb1350371177d2f001e0aea82c3cc703759918.tar.gz
pillowcase-8abb1350371177d2f001e0aea82c3cc703759918.tar.bz2
pillowcase-8abb1350371177d2f001e0aea82c3cc703759918.zip
Neatened the code a bit
Diffstat (limited to 'index.php')
-rwxr-xr-xindex.php25
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
5ob_start(); 5ob_start();
6 6
7$posts = array();
8
9if (isset($_GET['id'])) 7if (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
45if ($id > 2) 46if ($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>