私はこの方法から日時を取得します:
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 />
日時を取得する宣言が間違っていますか?