WBCE CMS Forum

WBCE CMS – Way Better Content Editing.

Du bist nicht angemeldet.

#1 26.08.2026 00:52:18

hpzaun
Mitglied

SQL-Fehler im Error-Log DELETE FROM WHERE DAY -> WBstats?

Hallo,

Ich hatte vor einiger Zeit in einer meiner WBCE Installationen den Besucherzähler von WBstats aktiviert.
Jetzt bemerkte ich folgende periodische Fehler im Errorlog viewer..

[25-Aug-2026 22:02:48 UTC] 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 `day` < '20260527'' at line 1
[25-Aug-2026 22:02:48 UTC] DELETE FROM WHERE `day` < '20260527'
[25-Aug-2026 22:20:54 UTC] 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 `day` < '20260527'' at line 1
[25-Aug-2026 22:20:54 UTC] DELETE FROM WHERE `day` < '20260527'

Ob ein direkter Zusammenhang besteht, ist mir aber unklar.
Nach meiner Vermutung liegt der Fehler im WBstats v0.2.5.9. Dort gibt es in class.count.php und class.stats.php
mit WHERE DAY

[== PHP ==]
$database->query("DELETE FROM ".$table_pages." WHERE `day` < '".$this->old_date."'");
		$database->query("DELETE FROM ".$table_ref.  " WHERE `day` < '".$this->old_date."'");
		$database->query("DELETE FROM ".$table_key.  " WHERE `day` < '".$this->old_date."'");

Da ich den Fehler selbst nicht weiter debuggen kann, würde ich mich freuen, wenn ihr das bei Gelegenheit prüfen könntet.

WBCE Version: 1.6.8
PHP Version: 8.2.33

Vielen Dank und schöne Grüße
hpzaun

Offline

#2 27.08.2026 12:48:22

stefanek
Core-Team

Re: SQL-Fehler im Error-Log DELETE FROM WHERE DAY -> WBstats?

Hallo hpzaun,

magst Du die angehängte Datei im Modulordner austauschen (mache ein backup der gegenwärtigen Datei) und es nochmal probieren?

Christian


“Success is the progressive realization of a worthy ideal.” ― Earl Nightingale

Offline

#3 30.08.2026 19:36:45

hpzaun
Mitglied

Re: SQL-Fehler im Error-Log DELETE FROM WHERE DAY -> WBstats?

Hallo,
ich habe den Austausch vorgenommen und es beobachten.


Ich melde mich in 1 bis 2 Tagen.
Schöne Grüße
Hans-Peter

Offline

Liked by:

stefanek

#4 30.08.2026 23:10:52

hpzaun
Mitglied

Re: SQL-Fehler im Error-Log DELETE FROM WHERE DAY -> WBstats?

Hallo,
ich habe heute Abend schon geprüft. Leider immer noch da.

[30-Aug-2026 21:08:17 UTC] 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 `day` < '20260601'' at line 1
[30-Aug-2026 21:08:17 UTC] DELETE FROM WHERE `day` < '20260601'
[30-Aug-2026 21:08:27 UTC] 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 `day` < '20260601'' at line 1
[30-Aug-2026 21:08:27 UTC] DELETE FROM WHERE `day` < '20260601'

Offline

#5 30.08.2026 23:33:12

stefanek
Core-Team

Re: SQL-Fehler im Error-Log DELETE FROM WHERE DAY -> WBstats?

Ich sehe, es war eine weitere Datei, die ähnlich Probleme bereitet.
Bitte überschreibe den Inhalt der angehängten zip (2 Dateien plus info.php).

Damit sollte es nun funktionieren.
(Gerne wieder Backup der Dateien machen.)

Im Übrigen: es wird an einem neuen Analytics Tool gearbeitet:
https://forum.wbce.org/viewtopic.php?pid=49098

Schönen Gruß,
Christian


“Success is the progressive realization of a worthy ideal.” ― Earl Nightingale

Offline

#6 01.09.2026 23:15:42

hpzaun
Mitglied

Re: SQL-Fehler im Error-Log DELETE FROM WHERE DAY -> WBstats?

Hallo,
ich habe die geänderten Dateien per FTP übertragen und werde es beobachten.
Melde mich in den nächsten Tagen.
Schöne Grüße
hpzaun

Offline

Liked by:

stefanek

#7 07.09.2026 21:07:25

hpzaun
Mitglied

Re: SQL-Fehler im Error-Log DELETE FROM WHERE DAY -> WBstats?

Hallo,
Leider gibt es weiter Log-Einträge
[07-Sep-2026 19:01:15 UTC] 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 `day` < '20260609'' at line 1
[07-Sep-2026 19:01:15 UTC] DELETE FROM WHERE `day` < '20260609'

Ich habe jetzt den Besucherzähler zunächst ausgeschaltet.
Mal sehen, ob die Error-Logs weiter kommen.

Ich melde mich.
Schöne Grüße
Hpzaun

Offline

#8 08.09.2026 15:06:44

stefanek
Core-Team

Re: SQL-Fehler im Error-Log DELETE FROM WHERE DAY -> WBstats?

Kannst Du bitte auch die Zeile schicken, die unmittelbar vor
"[07-Sep-2026 19:01:15 UTC] You have an error in your SQL syntax..." kommt?

Und sage mir, inkludierst Du das Module über das Template mit include() oder verwendest Du es über eine Seite (Seite vom Typ wbstats)?

Christian


“Success is the progressive realization of a worthy ideal.” ― Earl Nightingale

Offline

#9 10.09.2026 22:54:47

hpzaun
Mitglied

Re: SQL-Fehler im Error-Log DELETE FROM WHERE DAY -> WBstats?

Hallo,
es sind immer nur die zwei Zeilen im Wechsel.

[10-Sep-2026 20:43:33 UTC] 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 `day` < '20260612'' at line 1
[10-Sep-2026 20:43:33 UTC] DELETE FROM WHERE `day` < '20260612'
[10-Sep-2026 20:43:42 UTC] 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 `day` < '20260612'' at line 1
[10-Sep-2026 20:43:42 UTC] DELETE FROM WHERE `day` < '20260612'

Der Besucherzähler läuft über eine Seite mit Sichtbarkeit: Registriert über einen Hauptblock Modul: Code2 ID: 122. siehe unten
Der Aufruf erfolgt dann in der Fußzeile bei den Grundeinstellungen Allgemeine Optionen mit einen SectionPicker.
<!-- [[SectionPicker?sid=122]] auf Kommentar seit 07.09.2026 21 Uhr -->

Trotz des SectionPicker auf Kommentar bleibt der Error im Log.
Am CSS hatte ich bei der Einrichtung nichts ergänzt. Das webezeheh hatte schon den include der count.php drin.

[== PHP ==]
<head>
	
	<?php
	 if (file_exists(WB_PATH.'/modules/wbstats/count.php')) { 
		include (WB_PATH.'/modules/wbstats/count.php'); 
	} else {
			echo "<!-- wbstadts not found -->";
	}
include_once (WB_PATH.'/modules/wbstats/class.stats.php');
$object = new stats();
$websitestats = $object->getStats();

// DEINE SCHRIFT-EINSTELLUNGEN:
$font_family = "sans-serif"; // Schriftart
$font_size   = "17px";              // Schriftgröße
$font_color  = "#000000";           // Schriftfarbe (Hex-Code)
$font_weight = "normal";            // "normal" oder "bold" (fett)

// CSS-Style-String zusammenbauen
$style = "font-family: {$font_family}; font-size: {$font_size}; color: {$font_color}; font-weight: {$font_weight};";

// Ausgabe mit Formatierung (Zahlen mit Tausendertrennzeichen versehen):
echo '<div class="wbstats-footer" style="' . $style . '">';
echo 'Besucher gesamt: ' . number_format($websitestats['visitors'], 0, ',', '.');
echo ' &bull; Gerade online: ' . number_format($websitestats['online'], 0, ',', '.');
echo ' &bull; Heute: ' . number_format($websitestats['today'], 0, ',', '.');
echo '</div>';

Offline

#10 11.09.2026 11:39:22

stefanek
Core-Team

Re: SQL-Fehler im Error-Log DELETE FROM WHERE DAY -> WBstats?

hpzaun schrieb:

Hallo,
es sind immer nur die zwei Zeilen im Wechsel.

[10-Sep-2026 20:43:33 UTC] 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 `day` < '20260612'' at line 1
[10-Sep-2026 20:43:33 UTC] DELETE FROM WHERE `day` < '20260612'
[10-Sep-2026 20:43:42 UTC] 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 `day` < '20260612'' at line 1
[10-Sep-2026 20:43:42 UTC] DELETE FROM WHERE `day` < '20260612'

Da muss noch was anderes stehen, etwas das sich auf die aufgerufene Datei bezieht, so dass ich weiß, wo "at line 1" zu suchen ist.

Christian


“Success is the progressive realization of a worthy ideal.” ― Earl Nightingale

Offline

#11 01.10.2026 23:35:06

hpzaun
Mitglied

Re: SQL-Fehler im Error-Log DELETE FROM WHERE DAY -> WBstats?

Hallo Christian,

Ich war mit dem Motorrad in Schottland und kann mich daher erst jetzt wieder melden.

Ich habe die Logs etwas durchsucht. In den Var-Datei tausche einige Hinweise auf, die im Backend-Log nicht gesehen oder übersehen habe.
Beispiel unten.

Ich kann dir gerne die gesamten Logs per PM schicken, wenn es dir etwas hilft.

Schöne Grüße
hpzaun

2026-09-01T21:10:00+00:00 [Warning] /modules/wbstats/class.stats.php:[160]  from /modules/code2/view.php:[52]  "Trying to access array offset on value of type null"
2026-09-01T21:10:00+00:00 [Warning] /modules/wbstats/class.stats.php:[160]  from /modules/code2/view.php:[52]  "Trying to access array offset on value of type null"
[01-Sep-2026 21:10:00 UTC] 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 `day` < '20260603'' at line 1
[01-Sep-2026 21:10:00 UTC] DELETE FROM  WHERE `day` < '20260603'
2026-09-01T21:10:17+00:00 [Visitor Request] https://link_zur_hosting_Nr_entfernt.net/jfe/pages/links/statistik.php?visitors
2026-09-01T21:10:17+00:00 [Exception] There was an unknown exception: array_key_exists(): Argument #2 ($array) must be of type array, null given in line (240) of /modules/wbstats/class.stats.php
2026-09-01T21:10:23+00:00 [Visitor Request] https://link_zur_hosting_Nr_entfernt.net/jfe/pages/links/statistik.php?visitors
2026-09-01T21:10:23+00:00 [Exception] There was an unknown exception: array_key_exists(): Argument #2 ($array) must be of type array, null given in line (240) of /modules/wbstats/class.stats.php
2026-09-01T21:10:25+00:00 [Visitor Request] https://link_zur_hosting_Nr_entfernt.net/jfe/pages/links/statistik.php?visitors
2026-09-01T21:10:25+00:00 [Exception] There was an unknown exception: array_key_exists(): Argument #2 ($array) must be of type array, null given in line (240) of /modules/wbstats/class.stats.php
2026-09-01T21:10:28+00:00 [Visitor Request] https://link_zur_hosting_Nr_entfernt.net/jfe/pages/links/statistik.php?visitors
2026-09-01T21:10:28+00:00 [Exception] There was an unknown exception: array_key_exists(): Argument #2 ($array) must be of type array, null given in line (240) of /modules/wbstats/class.stats.php
[01-Sep-2026 21:10:54 UTC] 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 `day` < '20260603'' at line 1
[01-Sep-2026 21:10:54 UTC] DELETE FROM  WHERE `day` < '20260603'
[01-Sep-2026 21:10:55 UTC] 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 `day` < '20260603'' at line 1
[01-Sep-2026 21:10:55 UTC] DELETE FROM  WHERE `day` < '20260603'
[01-Sep-2026 21:10:58 UTC] 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 `day` < '20260603'' at line 1
[01-Sep-2026 21:10:58 UTC] DELETE FROM  WHERE `day` < '20260603'

Offline

Fußzeile des Forums

up