The select:
SELECT pr.predmet AS naziv_predmeta,
pr.protustranka_naziv AS protustranka
WHERE pr.datetime > Date_add (Now(), INTERVAL 24 hour)
I keep getting
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 ‘WHERE pr.datetime > Date_add (Now(), INTERVAL 24 hour)’ at line > 3
Table structure:
protustranka_naziv varchar(255)
predmet varchar(255)
datetime datetime
EDIT: Ok, so the first step was to add the FROM clause /facepalm. But the problem is, I still keep getting an error message. This is the query:
SELECT pr.predmet AS naziv_predmeta, pr.protustranka_naziv AS protustranka
FROM ou_predmeti
WHERE pr.datetime > DATE_ADD( NOW( ) , INTERVAL 24 HOUR )
LIMIT 0 , 30
This is the message:
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 ‘) LIMIT 0, 30’ at line 4
EDIT2: I missed again, it should have been FROM ou_predmeti pr
You forgot your
FROMclause