FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Installation Issues » Updated MySql 4->5
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Updated MySql 4->5 [message #31124] Mon, 03 April 2006 16:55 Go to next message
marten is currently offline  marten   Germany
Messages: 5
Registered: April 2006
Karma: 0
Junior Member
Hi,

On the server where my Fudforum 2.6.0 (in eGroupWare 1.2.7) is running, they updated mysql from 4 to 5. eGroupWare is just working fine, only I got problems in Fudforum.

I see all Categories and Forums, only when I want to enter a forum I get the next error:
(/data/usr/sviatos/sites/www.sviatoslav.com/HTML/fudforum/3814588639/index.php:131
/data/usr/sviatos/sites/www.sviatoslav.com/HTML/fudforum/3814588639/theme/default/thread.php:305
/data/usr/sviatos/sites/www.sviatoslav.com/HTML/fudforum/3814588639/theme/default/thread.php:328
/data/usr/sviatos/sites/www.sviatoslav.com/HTML/fudforum/3814588639/index.php:414
) 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 'reads FROM phpgw_fud_fc_view v INNER JOIN phpgw_fud_forum f ON f.id=v.f ' at line 1
Query: 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=4 ORDER BY v.id
Server Version: 5.0.19
[Referring Page] http://sviatos.lootsma.info/fudforum/3814588639/index.php?

I checked it in mysql console, the quiery only work when I remove the CASE WHEN part. So all field names are correct.

Is this just an MySql 5 error? How can I repair this.

Thanks in advance
Re: Updated MySql 4->5 [message #31136 is a reply to message #31124] Tue, 04 April 2006 13:43 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Try to put the
CASE WHEN 0 < m.post_stamp AND (fr.last_view IS NULL OR m.post_stamp > fr.last_view) THEN 1 ELSE 0 END

block in braces and see if that fixes the error.


FUDforum Core Developer
Re: Updated MySql 4->5 [message #31148 is a reply to message #31124] Tue, 04 April 2006 23:25 Go to previous messageGo to next message
marten is currently offline  marten   Germany
Messages: 5
Registered: April 2006
Karma: 0
Junior Member
mysql> 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 test 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=4 ORDER BY v.id;
... data ...
13 rows in set (0.00 sec)


Well, this supprices me. 'reads' is probably a reserved name for MySql. Because when I change 'AS reads' to 'AS test' everything is fine. Or maybe some server specific variable?

Nobody else the same problem??

I'll will try to make it work by changing the name.
Re: Updated MySql 4->5 [message #31149 is a reply to message #31124] Tue, 04 April 2006 23:40 Go to previous message
marten is currently offline  marten   Germany
Messages: 5
Registered: April 2006
Karma: 0
Junior Member
Ok, that wasn't so big deal in the end.

The value 'reads' is never used, so I just renamed it to 'reads_', even I don't know if it should be there at all.

For the record, the code gave problem on two locations. Both in the theme->default directory. Changed files:
thread.php
msg.php

After I just renamed reads to reads_ everything just works fine.

Thanks
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Mysql charset changer ( admin control panel)
Next Topic: installation help on iis5
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun May 19 03:04:07 GMT 2024

Total time taken to generate the page: 0.03478 seconds