Hi Logician, I was wondering if you can solve my puzzle:
I'm using your default web query
$WQ_last10threadfromforum2 but changed it to extract threads from forum#121 and it works as it should.
PHP Code:
SELECT threadid, title, postusername,postuserid,dateline
FROM " . TABLE_PREFIX . "thread
WHERE sticky=0 AND visible=1 AND forumid=121
ORDER BY dateline DESC
LIMIT 10
I duplicated that web query (
$WQ_last10threadfromforum3) and tried to extract the threads from forumid=230 but it didn't work. The resulting display was blank.
PHP Code:
SELECT threadid, title, postusername,postuserid,dateline
FROM " . TABLE_PREFIX . "thread
WHERE sticky=0 AND visible=1 AND forumid=230
ORDER BY dateline DESC
LIMIT 1
... and so I executed an SQL Query and noticed the following error:
Quote:
An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: 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 '" . TABLE_PREFIX . "thread
WHERE sticky=0 AND visible=1 AND forumid=230
ORDER' at line 2
|
So, I did the same with the code that works as it should:
Quote:
An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: 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 '" . TABLE_PREFIX . "thread
WHERE sticky=0 AND visible=1 AND forumid=121
ORDER' at line 2
|
But that one does in fact display the last ten threads from forum#121.
I did try to read the 5.1.72 manual until my eyes crossed and fell out on to my cheeks.
Can you help please?
Logician's WebTemplates 4.0.2
MySQL Version - 5.1.72-cll
vB 4.2.2