我通过这种方式获得日期时间:
class DB_Functions extends DB_Connect{
private $dbConnect = "";
public $dtime;
public function __construct() {
$this->dbConnect = $this->pdo_connect();
$this->dtime = new DateTime();
}
public function destruct() {
$this->dbConnect = null;
}
public function exampleInsert() {
.
.
.
$result->bindParam(':dateCreation',$this->dtime->format("Y-m-d H:i:s"),PDO::PARAM_STR);
}
}
然后当我使用dtime插入表时,如下所示:
Line 1708: $result->bindParam(':dateCreation',$this->dtime->format("Y-m-d H:i:s"),PDO::PARAM_STR);
显示此错误:
<b>Strict Standards</b>: Only variables should be passed by reference in <b>include\DB_Functions.php</b> on line <b>1708</b><br />
我获得日期时间的声明是错误的?