我有这段代码目前在我网站的另一个页面上运行良好..
$sql = "SELECT topics.topic_id, topics.topic_subject, topics.topic_date, topics.topic_cat, topics.topic_by, users.user_name, users.avatar, categories.cat_id, categories.cat_name
FROM topics
LEFT JOIN users ON topics.topic_by=users.user_id
LEFT JOIN categories ON categories.cat_id=topics.topic_cat
WHERE topics.topic_cat = " . mysql_real_escape_string($_GET['id']) . " ORDER BY topics.topic_date DESC;";
这将USER AVATAR放在主题帖子上,现在我正在尝试应用于回复/主题线程并且它不起作用,这是我正在使用的代码。
$posts_sql = "SELECT
posts.post_topic,
posts.post_content,
posts.post_date,
posts.post_by,
users.user_id,
users.user_name,
users.avatar
FROM
posts
LEFT JOIN users
ON
posts.post_by = users.user_id
WHERE
posts.post_topic = " . mysql_real_escape_string($_GET['id']);
不知道我做错了什么,但它打破了页面。