我沒有看到的錯誤,並希望有人能搞清楚:準備好的聲明中通過引用傳遞錯誤
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;
}
函數調用
MessageCenter ::的CreateMessage(「你好」,「只要打電話來打個招呼「,」2009-09-12「,」2009-09-12「,」1「,」1「);
錯誤消息:
致命錯誤:無法通過引用
尼斯徹底響應 – 2009-09-02 19:32:27
@Peter:感謝:-) – 2009-09-02 19:34:07