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 に答える