如何在 PostgreSQL 中插入日期?这似乎是错误的:
public function insert( $name, $author ) {
$this->query = "INSERT INTO people ( name, author, date )
VALUES ( '$name', '$author', to_timestamp('2/3/2016 12:05')";
return $result = pg_query( $this->connection, $this->query );
}
$database->insert( 'someName', 'SomeAuthor' );
最佳答案
'2016-03-02 12:05:00' 是一种方式...
$this->query = "INSERT INTO people ( name, author, date )
VALUES ( '$name', '$author', '2016-03-02 12:05:00')";
关于php - 如何将日期值插入 PostgreSQL 表中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49309004/