summaryrefslogtreecommitdiff
path: root/includes/funktion_counter.php
diff options
context:
space:
mode:
authorMoritz helios Rudert <helios@planetcyborg.de>2011-06-01 12:13:39 +0200
committerMoritz helios Rudert <helios@planetcyborg.de>2011-06-01 12:13:39 +0200
commit75448045cfe70054c8f4bae1bcfaf9bb0f70d330 (patch)
tree6a4d3d35019cdf933c1816e8522dc5d2557f5238 /includes/funktion_counter.php
parent12e0b0d809c29d435a247798d7318cc9835980ea (diff)
fixes
Diffstat (limited to 'includes/funktion_counter.php')
-rw-r--r--includes/funktion_counter.php36
1 files changed, 13 insertions, 23 deletions
diff --git a/includes/funktion_counter.php b/includes/funktion_counter.php
index 70b104d4..39d65a1f 100644
--- a/includes/funktion_counter.php
+++ b/includes/funktion_counter.php
@@ -1,24 +1,14 @@
-<?PHP
-
-$SQL = "SELECT `Anz` FROM `Counter` WHERE `URL`=\"". $Page["Name"]. "\"";
-$Erg = mysql_query($SQL, $con);
-
-echo mysql_error($con);
-
-if(mysql_num_rows($Erg)==0)
-{
-// echo "Counter: 1";
- $SQL = "INSERT INTO `Counter` ( `URL` , `Anz` ) ".
- "VALUES ('". $Page["Name"]. "', '1');";
- $Erg = mysql_query($SQL, $con);
-}
-elseif(mysql_num_rows($Erg)==1)
-{
-// echo "Counter: ". (mysql_result($Erg, 0, 0)+1);
- $SQL = "UPDATE `Counter` SET `Anz` = '". (mysql_result($Erg, 0, 0) +1). "' ".
- "WHERE `URL` = '". $Page["Name"]. "' LIMIT 1 ;";
- $Erg = mysql_query($SQL, $con);
-}
-
-
+<?php
+ $SQL = "SELECT `Anz` FROM `Counter` WHERE `URL`=\"" . $Page["Name"] . "\"";
+ $Erg = mysql_query($SQL, $con);
+
+ echo mysql_error($con);
+
+ if(mysql_num_rows($Erg) == 0) {
+ $SQL = "INSERT INTO `Counter` ( `URL` , `Anz` ) VALUES ('" . $Page["Name"] . "', '1');";
+ $Erg = mysql_query($SQL, $con);
+ } elseif(mysql_num_rows($Erg) == 1) {
+ $SQL = "UPDATE `Counter` SET `Anz` = '" . (mysql_result($Erg, 0, 0) +1) . "' WHERE `URL` = '" . $Page["Name"] . "' LIMIT 1 ;";
+ $Erg = mysql_query($SQL, $con);
+ }
?>