老師的gc方法好像寫錯了,應該這樣寫
public?function?gc?($maxlifetime)
{
???$sql?=?"delete?from?sessions?where?session_expires+'{$maxlifetime}'<"?.?time?();
???mysqli_query?($this?->?link,?$sql);
???if?(?mysqli_affected_rows?($this?->?link)?>?0?)?{
??????return?true;
???}
???return?false;
}
2020-02-16
你這么寫是錯的吧,mysqli_affected_rows里面不應該是個查詢出來的資源么。。。