问题
I am currently making a comment section with two tables. One is the main comment section, I can comment and it uploads to the server. The replies also upload to the server, however they do no display on the website and it returns this error witht he line of code affected, this is the php code...
if (isset($_POST['addComment'])) {
$comment = $conn->real_escape_string($_POST['comment']);
$isReply = $conn->real_escape_string($_POST['isReply']);
$commentID = $conn->real_escape_string($_POST['commentID']);
if ($isReply) {
$conn->query("INSERT INTO replies (replyMessage, commentID, userID, createdOn) VALUES ('$comment', '$commentID', '$user_id', NOW())");
$sqlGetComment = $conn->query("SELECT replies.repliesID, uidUsers, message, DATE_FORMAT(replies.createdOn, '%Y-%m-%d') AS createdOn FROM replies
INNER JOIN users ON replies.userID = users.idUsers ORDER BY replies.repliesID DESC LIMIT 1");
} else {
$conn->query("INSERT INTO user_comment_table (user_id, message, created_on) VALUES ('$user_id', '$comment', NOW())");
$sqlGetComment = $conn->query("SELECT user_comment_table.comment_id, uidUsers, message, DATE_FORMAT(user_comment_table.created_on, '%Y-%m-%d') AS created_on FROM user_comment_table
INNER JOIN users ON user_comment_table.user_id = users.idUsers ORDER BY user_comment_table.comment_id DESC LIMIT 1");
}
$data = fetch_assoc($sqlGetComment);
exit(createCommentRow($data));
}
any ideas on what to do guys? If anyone could lend a hand it would be much appreciated.
来源:https://stackoverflow.com/questions/59548786/i-can-upload-to-server-fatal-error-uncaught-error-call-to-undefined-function