I have installed phpnuke 7.8 and in my testing I created some topics and posted some news which appears OK in the fist page as the News module is set selected for the first page.
But when I clik on the topics in the main menu, the topics module shows nothing and give me a message that there is no articles.
I tried to see the Topics module code (I not an expert) and I but an echo message to check what sort of SQL message is sent to the mysql. I got the query printed and as shown:
SELECT t.topicid, t.topicimage, t.topictext, count(s.sid) AS stories, SUM(s.counter) AS reads FROM nuke_topics t LEFT JOIN nuke_stories s ON (s.topic = t.topicid) GROUP BY t.topicid, t.topicimage, t.topictext ORDER BY t.topictext
I copied the quesy and try to run it in mysqlAdmin and I got an error and as shown:
SQL-query :
SELECT t.topicid, t.topicimage, t.topictext, count( s.sid ) AS stories, SUM( s.counter ) AS reads
FROM nuke_topics
LEFT JOIN nuke_stories s ON ( s.topic = t.topicid )
GROUP BY t.topicid, t.topicimage, t.topictext
ORDER BY t.topictext
LIMIT 0 , 30
MySQL said:
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 nuke_topics LEFT JOIN nuke_stories s ON ( s.topic =
The original php code which generate this message inside the Topics module index.php:
$sql = "SELECT t.topicid, t.topicimage, t.topictext, count(s.sid) AS stories, SUM(s.counter) AS reads FROM ".$prefix."_topics t LEFT JOIN ".$prefix."_stories s ON (s.topic = t.topicid) GROUP BY t.topicid, t.topicimage, t.topictext ORDER BY t.topictext";
echo $sql;
$result = $db->sql_query($sql);
if ($db->sql_numrows($result) > 0) {
..
..
Please can any body help and tell me whats wrong. Help I am lost
Thanks alot
New & More Info:
1. I used an phpNuke 7.8 with arabic labg support.
2. I replaced the 7.8 topic module with an older one (may be 7.2) and It works just fine.
I beileve now more at the problem is from the code that generate the query (May be )
Evaders99 Site Admin
Joined: Aug 17, 2003
Posts: 12349
Posted:
Wed Nov 15, 2006 6:45 am
Hmm what version of MySQL are you using? I believe it is dying on the reads part because reads is a reserved word
MySQL version is 5.0.24a.
I took your not abour reads. I changed the SQL query above (i sed any name in stade of reads) and the quesry was successful.
So, is it a bug or reads haven reserved in SQL ver.5.
I checked phpnuke 8 Topics module and it uses the same programing lines and gives the same query.
Can you tell me where is the problem and wgy this module is working in your sit for example as tens of other sites (may be thousends) but not with me. is it SQL5. I will try to change the Topics module with another variable name in stade of reads and see but please can you help.
Thanks alot tou and all the others in Nukecops
Evaders99 Site Admin
Joined: Aug 17, 2003
Posts: 12349
Posted:
Thu Nov 16, 2006 6:19 pm
Generally phpBB and phpNuke do not support MySQL 5. I would suggest using MySQL 4 right now
Hei
Thanks for the explanation.
I have changed the variable name in the Topics module (index.php file) from reads to reado (this variable appears in 3 places in the code) and every thing works well under mySQL 5 (tested with nuke 7.
Thanks a lot for the tip about reads, it helped in fixing the module. If any one intrested, or have similar problem with Topics module, just leave a not or PM.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum