I have a query :
=============== ==========
SELECT users.username, posts.post_id, users.user_id, posts.post_time ,
post_text.post_ subject, post_text.post_ text, topics.topic_ti tle
FROM `phpbbtes_posts ` posts, `phpbbtes_posts _text` post_text,
`phpbbtes_users ` users, `phpbbtes_topic s` topics
WHERE posts.post_id = post_text.post_ id
AND posts.poster_id = users.user_id
AND posts.topic_id = topics.topic_id
AND topics.forum_id NOT IN (
SELECT forum_id
FROM phpbbtes_hidden _forums
)
ORDER BY posts.post_time DESC
LIMIT 0 , 5
=============== ============
When I hardcode the values in the subquery like this :
=============== ============
SELECT users.username, posts.post_id, users.user_id, posts.post_time ,
post_text.post_ subject, post_text.post_ text, topics.topic_ti tle
FROM `phpbbtes_posts ` posts, `phpbbtes_posts _text` post_text,
`phpbbtes_users ` users, `phpbbtes_topic s` topics
WHERE posts.post_id = post_text.post_ id
AND posts.poster_id = users.user_id
AND posts.topic_id = topics.topic_id
AND topics.forum_id NOT
IN (
84,12,34,116,38 ,54,39,43,48,90 ,104,105,107,10 8,113,110,111,1 12,60,94,64,85, 91,117,127,128, 130,126,123,129 ,124,131,132,12 5,119,118,121,1 20,122,28,8,106 ,7,92,9,26,86,1 15,93
)
ORDER BY posts.post_time DESC
LIMIT 0 , 5
=============== =============
everything runs okay.
The topics.forum_id is smallint(8) and the forum_id is smallint(8)
I keep getting an error 1064.
Any help would be most appreciated.
Chris
=============== ==========
SELECT users.username, posts.post_id, users.user_id, posts.post_time ,
post_text.post_ subject, post_text.post_ text, topics.topic_ti tle
FROM `phpbbtes_posts ` posts, `phpbbtes_posts _text` post_text,
`phpbbtes_users ` users, `phpbbtes_topic s` topics
WHERE posts.post_id = post_text.post_ id
AND posts.poster_id = users.user_id
AND posts.topic_id = topics.topic_id
AND topics.forum_id NOT IN (
SELECT forum_id
FROM phpbbtes_hidden _forums
)
ORDER BY posts.post_time DESC
LIMIT 0 , 5
=============== ============
When I hardcode the values in the subquery like this :
=============== ============
SELECT users.username, posts.post_id, users.user_id, posts.post_time ,
post_text.post_ subject, post_text.post_ text, topics.topic_ti tle
FROM `phpbbtes_posts ` posts, `phpbbtes_posts _text` post_text,
`phpbbtes_users ` users, `phpbbtes_topic s` topics
WHERE posts.post_id = post_text.post_ id
AND posts.poster_id = users.user_id
AND posts.topic_id = topics.topic_id
AND topics.forum_id NOT
IN (
84,12,34,116,38 ,54,39,43,48,90 ,104,105,107,10 8,113,110,111,1 12,60,94,64,85, 91,117,127,128, 130,126,123,129 ,124,131,132,12 5,119,118,121,1 20,122,28,8,106 ,7,92,9,26,86,1 15,93
)
ORDER BY posts.post_time DESC
LIMIT 0 , 5
=============== =============
everything runs okay.
The topics.forum_id is smallint(8) and the forum_id is smallint(8)
I keep getting an error 1064.
Any help would be most appreciated.
Chris
Comment