I'm not seeing the error and was hoping someone could figure it out:
public static function createMessage($title, $message, $startDate, $endDate, $author, $status){
//$dbConn is now a mysqli instance with a connection to the database foobar
$dbConn = Database::getConnection("foobar");
$stmt = $dbConn->prepare("INSERT into messages(title, msg, date_start, date_end, app_usersID_FK, date_created, activeflag, msg_status) VALUES (?,?,?,?,?,?,?,?)");
if(!$stmt){
throw new Exception("Unable to prepare the statement");
}
$dt = date("Y-m-d");
$stmt->bind_param("ssssisii", $title, $message, $startDate, $endDate, $author, $dt, 1, $status);
$stmt->execute();
return true;
}
Function call
MessageCenter::createMessage("Hello", "Just calling to say hi", "2009-09-12", "2009-09-12", "1", "1");
Error Message is:
Fatal error: Cannot pass parameter 8 by reference