Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/30/2021 in all areas

  1. Yes. You're loading your existing comments in the constructor of the Comments class, so all your data gets loaded here: $comment = new Comment(Input::get("post_id")); The data you load at that point is what you'll end up displaying later on when you call display() and count(). Whether or not $message is true isn't really relevant to how this functions. That's wrong from a syntax perspective. If that's what you have, you should be getting a syntax error I would think. You don't use <?php ?> tags to embed variables into strings. You use concatenation and/or interpolation. Redirect::to("single_post.php?post_id=$post_id&related=$related"); With the syntax fixed, replace your $message = true; line with the redirect. You'll need to use an alternate means of determining whether or not to show your message, such as by adding a message=true parameter to the URL or storing something in the session. This is possibly related to the bad syntax of the redirect. Notice in the stack trace it shows the php tags as part of the parameters: Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in /opt/lampp/htdocs/qcic/assets/class/DB.php:35 Stack trace: #0 /opt/lampp/htdocs/qcic/assets/class/DB.php(35): PDOStatement->execute() #1 /opt/lampp/htdocs/qcic/assets/class/DB.php(121): DB->query('UPDATE posts SE...', Array) #2 /opt/lampp/htdocs/qcic/assets/class/Post.php(227): DB->update('posts', '<?php echo 86; ...', Array) ------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^ #3 /opt/lampp/htdocs/qcic/newsnet/single_post.php(16): Post->viewCount('<?php echo 86; ...') ---------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^ #4 {main} thrown in /opt/lampp/htdocs/qcic/assets/class/DB.php on line 35
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.