0

我想插入用户注册的时间:

function InsertUserToSql()  
...
$stmt = $this->dbh->prepare("INSERT INTO users 
(username, password, email, regdate) VALUES 
(:username,:password, :email, :regdate)");

        $stmt->bindParam(':username', $this->Username);
        $stmt->bindParam(':password', $this->Password);
        $stmt->bindParam(':email', $this->Email);
        $stmt->bindParam(':regdate', time());  // this line shows the error
        $stmt->execute();
...

错误:Strict standards: Only variables should be passed by reference

4

1 回答 1

1
$stmt = $this->dbh->prepare("INSERT INTO users 
(username, password, email, regdate) VALUES 
(:username,:password, :email, UNIX_TIMESTAMP())");

至于错误消息 - 它非常适合谷歌搜索。

于 2012-12-26T19:21:59.227 回答