Re: SQL syntax error when trying to enter forums [message #29395 is a reply to message #29388] |
Sat, 17 December 2005 16:41 |
sommer
Messages: 21 Registered: December 2005 Location: Denmark
Karma:
|
Junior Member |
|
|
Hello Ilia
Thank you for your quick reply!
I am not quite sure what you mean by:
Ilia wrote on Fri, 16 December 2005 21:43 | Does the query work if you put the entire CASE ... END block inside braces?
|
...but I suppose you want me to run the SELECT query modified like this:
SELECT f.id, f.name, c.name, c.id,
CASE WHEN {0 < m.post_stamp
AND (
fr.last_view IS NULL
OR m.post_stamp > fr.last_view
)
THEN 1
ELSE 0
END AS reads}
FROM phpgw_fud_fc_view v...
So I've thied that using phpMyAdmin 2.7.0-pl1, which gives me this error:
Error
SQL query: Documentation
SELECT f.id, f.name, c.name, c.id,
CASE WHEN {0 < m.post_stamp
AND (
fr.last_view IS NULL
OR m.post_stamp > fr.last_view
)
THEN 1
ELSE 0
END AS reads}
FROM phpgw_fud_fc_view v
INNER JOIN phpgw_fud_forum f ON f.id = v.f
INNER JOIN phpgw_fud_cat c ON c.id = v.c
LEFT JOIN phpgw_fud_msg m ON m.id = f.last_post_id
LEFT JOIN phpgw_fud_forum_read fr ON fr.forum_id = f.id
AND fr.user_id =2
ORDER BY v.id
LIMIT 0 , 30
MySQL said: Documentation
#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 '0 < m . post_stamp AND ( fr . last_view IS NULL OR m . post_stamp > fr . last_vi' at line 1
I hope this gives you some kind of clue to what might be wrong.
Thanks,
Henrik
|
|
|