I have error_reporting
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:
$db=new mySQLi($host,$dbhuser,$dbhpwd,$dbh);
$insert_stmt = $db->stmt_init();
$insert_stmt = $db->prepare("INSERT INTO food (id,timestamp,userid,tagline,group,location,event_date,event_time,image,type) VALUES(NULL,NOW(),?,?,?,?,?,?,?,?)");
$insert_stmt->bind_param("issssssi",$_SESSION['id'],$tagline,$organizer,$location,$event_date,$event_time,$image_name,$food_id);
$insert_stmt->execute();
userid is an integer that I pull from a stored cookie.
$tagline, $organizer, $location, are text with max at 140 chars.
$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
$image_name is text, a file path
and type is an integer from 1-29.
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
Here is a screen shot of the setup in mysql for the table called food: