Bei folgendem Code:
Code: Alles auswählen
# Heute
#
# Themen
$time_today= mktime(0,0,0,date("m"),date("d"),date("Y"));
$where="post_date > $time_today";
$anz= $_db->fetch_array( $_db->query("SELECT COUNT(id) AS num
FROM $TB_TOPIC WHERE $where"));
$topics_today= $anz["num"];
# Beiträge
$anz= $_db->fetch_array( $_db->query("SELECT COUNT(id) AS num
FROM $TB_POST WHERE $where"));
$posts_today= $anz["num"];
#
#Gestern
#
# Themen
$yesterday=date("d")-1;
$time_yesterday= mktime(0,0,0,date("m"),$yesterday,date("Y"));
$where="post_date between $time_yesterday and $time_today";
$anz= $_db->fetch_array( $_db->query("SELECT COUNT(id) AS num
FROM $TB_TOPIC WHERE $where"));
$topics_yesterday= $anz["num"];
# Beiträge
$anz= $_db->fetch_array( $_db->query("SELECT COUNT(id) AS num
FROM $TB_POST WHERE $where"));
$posts_yesterday= $anz["num"];
SQL Error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE post_date > 1155247200' at line 2
SELECT COUNT(id) AS num
FROM WHERE post_date > 1155247200
SQL Error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE post_date > 1155247200' at line 2
SELECT COUNT(id) AS num
FROM WHERE post_date > 1155247200
SQL Error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE post_date between 1155160800 and 1155247200' at line 2
SELECT COUNT(id) AS num
FROM WHERE post_date between 1155160800 and 1155247200
SQL Error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE post_date between 1155160800 and 1155247200' at line 2
SELECT COUNT(id) AS num
FROM WHERE post_date between 1155160800 and 1155247200
Hat jemand eine Idee wo der Fehler in der Syntax liegen könnte?