作者:Duanzd09 | 来源:互联网 | 2023-10-11 07:16
cansomeonepleasehelpmeiamhavingproblemscreatingmyforum.有人请帮助我,我在创建论坛时遇到问题。Atthemomen
can someone please help me i am having problems creating my forum.
有人请帮助我,我在创建论坛时遇到问题。
At the moment users can create posts, the post title is listed down the page and then the user is suppose to be able to click the title link and be taken to read_post.php and then this should take the user to another page where the post content can be viewed, i am trying to do this by echoing the forum post id but it doesnt seem to want to work, instead i get this error:
目前用户可以创建帖子,帖子标题列在页面下方,然后用户可以点击标题链接并被带到read_post.php然后这应该将用户带到另一个页面的帖子内容可以查看,我试图通过回应论坛帖子ID来做到这一点但它似乎不想工作,而是我得到这个错误:
Database query failed: 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 '' at line 3
can someonee please show me where im going wrong.
有人可以告诉我哪里出错了。
here is my sql function:
这是我的sql函数:
function read_forum() {
global $connection;
global $forum_id;
$query = "SELECT *
FROM ptb_forum, ptb_profiles
WHERE ptb_forum.id = $forum_id ";
$forum_set = mysql_query($query, $connection);
confirm_query($forum_set);
return $forum_set;
}
here is the link code that takes the user to read_post.php which suppose to echo the forum id and display the content for each individual post.
这是将用户带到read_post.php的链接代码,它假设回显论坛ID并显示每个帖子的内容。
$forum_set = get_forum();
while ($forum = mysql_fetch_array($forum_set)) {
?>
{$forum['title']} - Posted by {$user['first_name']}"; ?>
here's my code for read_post.php:
";?>
"; ?>
Conversations between you and
{$forum['display_name']}. "; ?>
Message Subject: {$forum['subject']}"; ?>
Message:
{$forum['content']}"; ?>
include ('message_reply.php'); ?>
1 个解决方案