老師的gc方法好像寫(xiě)錯(cuò)了,應(yīng)該這樣寫(xiě)
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
你這么寫(xiě)是錯(cuò)的吧,mysqli_affected_rows里面不應(yīng)該是個(gè)查詢出來(lái)的資源么。。。