From 8abb1350371177d2f001e0aea82c3cc703759918 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 21 Feb 2009 10:55:14 -0500 Subject: Neatened the code a bit --- header.php | 7 +++++-- index.php | 25 +++++++++++++------------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/header.php b/header.php index 3b0dc8b..ebdee99 100644 --- a/header.php +++ b/header.php @@ -23,8 +23,11 @@ if (isset($title)) include_once('db.php'); -$getlast = mysql_fetch_array(mysql_query("SELECT * FROM config WHERE name = \"lastUpdated\"")); -$last = $getlast['value']; +$getlast = "SELECT * FROM config WHERE name = \"lastUpdated\""; +$getlast2 = mysql_query($getlast); +$getlast3 = mysql_fetch_array($getlast2); + +$last = $getlast3['value']; if ($last != date('md')) { $getpending = "SELECT * FROM pending ORDER BY id ASC LIMIT 0,1"; 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'); ob_start(); -$posts = array(); - if (isset($_GET['id'])) { - $getimages = "SELECT * FROM images WHERE id = " . $_GET['id']; + $getimage = "SELECT * FROM images WHERE id = " . $_GET['id']; } else { - $getimages = "SELECT * FROM images ORDER BY id DESC LIMIT 0,1"; + $getimage = "SELECT * FROM images ORDER BY id DESC LIMIT 0,1"; } -$getimages2 = mysql_query($getimages); -$getimage3 = mysql_fetch_array($getimages2); +$getimage2 = mysql_query($getimage); +$getimage3 = mysql_fetch_array($getimage2); ?>
@@ -39,8 +37,11 @@ $getimage3 = mysql_fetch_array($getimages2); 2) { @@ -68,10 +69,10 @@ if ($id < $all) } } -$getnpending = "SELECT COUNT(*) FROM pending"; -$getnpending2 = mysql_query($getnpending); -$getnpending3 = mysql_fetch_array($getnpending2); -$numpending = $getnpending3['COUNT(*)']; +$cntpending = "SELECT COUNT(*) FROM pending"; +$cntpending2 = mysql_query($cntpending); +$cntpending3 = mysql_fetch_array($cntpending2); +$numpending = $cntpending3['COUNT(*)']; ?> -- cgit 1.4.1