Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST['create_comment'])) {
- $the_post_id = $_GET['p_id'];
- $comment_author = $_POST['comment_author'];
- $comment_email = $_POST['comment_email'];
- $comment_content = $_POST['comment_content'];
- $query = "INSERT INTO comments(comment_post_id, comment_author, comment_email, comment_content, comment_status, comment_date) ";
- $query .= "VALUES({$the_post_id}, '{$comment_author}', '{$comment_email}', '{$comment_content}', 'unapproved', now())";
- $create_comment_query = mysqli_query($connection, $query);
- confirmQuery($create_comment_query);
- $query = "UPDATE posts SET post_comment_count = post_comment_count + 1 ";
- $query .= "WHERE post_id = $the_post_id ";
- $update_comment_count = mysqli_query($connection, $query);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement