无法让$row['post_topic']
将ID实际传递到回复页面。如果我手动输入ID,例如' 2',它可以正常工作。
echo '<form method="post" action="reply.php?id=' .$row['post_topic']. '">
<textarea name="reply-content"></textarea>
<input type="submit" value="Replyy" />
</form>';
修改
额外的注释,echo $row['post_topic'];
在我在同一个文件中的一个While循环中工作。
查询:
$sql= "SELECT
posts.post_topic,
posts.post_content,
posts.post_date,
posts.post_by,
users.user_id,
users.user_name
FROM
posts
LEFT JOIN
users
ON
posts.post_by = users.user_id
WHERE
posts.post_topic =
'" .mysqli_real_escape_string($connect, $_GET['id']). "'";
PHP:
$row = $resultpost->fetch_assoc();
echo $row['post_topic'];
echo '<br><table border="0"';
echo '<tr>';
echo '<th>';
echo '<form method="post" action="reply.php?id='.$row['post_topic']. '">
<textarea name="reply-content"></textarea>
<input type="submit" value="Reply" />
</form>';
echo '</th>';
echo '</tr>';
答案 0 :(得分:0)
使用gettype($row['post_topic'])
检查数据类型。这可能是个问题。