title: Fatal Error: Call to a member function execute() on a non-object with MySQL Left Join in PHP
body: <p>I am having some trouble with a left join in a simple blog script I am writing to go with my basic CMS.</p>
  
  <pre><code>$result = $dbc-&gt;prepare("SELECT blog.id, blog.title, blog.post, blog.date, blog.time, comments.blogid FROM blog LEFT JOIN comments ON blog.id = comments.blogid ORDER BY id DESC LIMIT $start_blog, $blog_per_page");
  $result-&gt;execute();
  $result-&gt;bind_result($id, $title, $post, $date, $time, $blogid);
  </code></pre>
  
  <p>The above code is returning the following error:
  Fatal error: Call to a member function execute() on a non-object in C:\xampp\htdocs\pcms\includes\blog.php on line 56 (with line 56 being $result ->execute();)</p>
  
  <p>I just cant see what is causing the error, if I remove the LEFT JOIN the SQL code is working fine.</p>