title: PHP syntax error for storing data into mysql db
body: <p>I have resolved the issue. The following code now works perfectly.
  Thank you all. </p>
  
  <p>Please the relevant section of dbcontroller.php file as follows:</p>
  
  <pre><code>&lt;?php
  class DBController {
  
  
  function runQuery2($query) {
      $result = mysql_query($query);
              return $result;
      }
  
   }
  </code></pre>
  
  <p>In addition, I have amended my original MySQL statements in my main html/php file to look like this:</p>
  
  <pre><code>&lt;?php
   session_start();
   require_once("dbcontroller.php");
   $db_handle = new DBController();
  
  
  if(!empty($_POST["submit"])) {
  
    if ($db_handle-&gt;runQuery2("INSERT INTO cquestionstable 
    (postid, ccode,    nick, queries) VALUES ( 1,'cc-001', 'james', 'what    
     could be the problem?')") === TRUE) {
      echo "New record created successfully";
       } else {
      echo "Error in posting question, pls try again." . "&lt;br&gt;";
     }
  
  ?&gt;
  </code></pre>
  
  <p>Thanks n cheers.</p>