Re: PDO and PGSQL: ERROR: syntax error at or near "SET"
| From: | David Tulloh | Date: | Mon, 07 Aug 2006 14:06:59 +0000 |
| Subject: | Re: PDO and PGSQL: ERROR: syntax error at or near "SET" | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-240246@lists.php.net to get a copy of this message | ||
Erik Gyepes wrote:
> ...
> $query = "INSERT INTO users SET uid = :uid, login = :login, password =
> :password";
> ...
> When running the script I get the following error message: Error!:
> SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "SET" at
> character 19
>
The INSERT INTO ... SET ... syntax is not standard SQL. It's a mysql
extension that isn't supported by any other sql databases, such as
postgresql.
The proper insert syntax is here:
http://www.postgresql.org/docs/8.0/interactive/dml.html#DML-INSERT
David