title: Issues with variables in bind_param()
body: <p>I have <code>error_reporting</code> all the way on and I've looked over it many times, so I think I might be calling a value wrong or didn't declare something correct.  Anyone who can jump in and tell me whats up with the code and why still the error " Call to a member function bind_param() on a non-object" because I'm stumped:</p>
  
  <pre><code>$db=new mySQLi($host,$dbhuser,$dbhpwd,$dbh); 
  $insert_stmt = $db-&gt;stmt_init();    
  $insert_stmt = $db-&gt;prepare("INSERT INTO food (id,timestamp,userid,tagline,group,location,event_date,event_time,image,type) VALUES(NULL,NOW(),?,?,?,?,?,?,?,?)");
          $insert_stmt-&gt;bind_param("issssssi",$_SESSION['id'],$tagline,$organizer,$location,$event_date,$event_time,$image_name,$food_id);
          $insert_stmt-&gt;execute();
  </code></pre>
  
  <p>userid is an integer that I pull from a stored cookie.</p>
  
  <p>$tagline, $organizer, $location, are text with max at 140 chars.</p>
  
  <p>$event_date = $event_date= substr(date('Y'),0,2).$year."-".$month."-".$day;
  $event_time= date("H:i:s", strtotime($hour.":".$minute.$period));
  - all these variable were users input as two digit numbers as text </p>
  
  <p>$image_name is text, a file path</p>
  
  <p>and type is an integer from 1-29.</p>
  
  <p>Here is an example result of the ? values for the database: 38, test, test, test, 2013-2-20, 14:15:00, Halloween_Beer_2.jpg, 7</p>
  
  <p>Here is a screen shot of the setup in mysql for the table called food:
  <img src="https://i.stack.imgur.com/6qyH8.png" alt="enter image description here"></p>