2
我從這種方式得到的日期時間:這是一個不正確的方式來獲取日期時間?
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 />
我的聲明獲取日期時間是錯誤的?
您發佈的DB_Functions類不是1700行。什麼*確切*在線1708? – 2013-02-08 18:36:32
可能重複? http://stackoverflow.com/questions/2967597/only-variables-can-be-passed-by-reference或至少相關 – Damp 2013-02-08 18:39:00
行1708是$ result-> bindParam(':dateCreation',$ this-> dtime- >格式(「Ymd H:i:s」),PDO :: PARAM_STR);在帖子中也是一樣。 – SoldierCorp 2013-02-08 18:39:24