Hi, ich bräuchte bitte einmal hilfe wo ich hier etwas übersehe bzw. wie der SQL Aufruf klappen würde.
Meine DB schaut wie folgt aus : Name der DB ist zeit
Tabelle 1: time_data
time_id , user_id , data_date , type_id , hours , hinweis
Tabelle 2: time_periods
period_id , start_date , end_date
Tabelle 3: time_types
type_id , beschreibung , hour
Tabelle 4: user_info
user_id , username , g_id
Wenn ich aber nun per PhpMylAdmin den folgenden Befehl ausführen möchte
SELECT * FROM `time_periods`, `time_types` , `user_info` , `time_data` , SUM(`time_data.hours`) as timesum WHERE user_info.user_id = time_data.user_id AND time_types.type_id = user_info.g_id AND user_info.user_id = 23
erhalte ich die Meldung
#1064 - 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 'SUM(`time_data.hours`) as timesum WHERE user_info.user_id = time_data.user_id AN' at line 1
Ich verstehe im mom. nicht ganz wo der Fehler liegt und wäre für Hilfe und Lösungen sehr dankbar
Meine DB schaut wie folgt aus : Name der DB ist zeit
Tabelle 1: time_data
time_id , user_id , data_date , type_id , hours , hinweis
Tabelle 2: time_periods
period_id , start_date , end_date
Tabelle 3: time_types
type_id , beschreibung , hour
Tabelle 4: user_info
user_id , username , g_id
Wenn ich aber nun per PhpMylAdmin den folgenden Befehl ausführen möchte
SELECT * FROM `time_periods`, `time_types` , `user_info` , `time_data` , SUM(`time_data.hours`) as timesum WHERE user_info.user_id = time_data.user_id AND time_types.type_id = user_info.g_id AND user_info.user_id = 23
erhalte ich die Meldung
#1064 - 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 'SUM(`time_data.hours`) as timesum WHERE user_info.user_id = time_data.user_id AN' at line 1
Ich verstehe im mom. nicht ganz wo der Fehler liegt und wäre für Hilfe und Lösungen sehr dankbar
