hi 

I am a cakephp newbie writing my first cake controller.
I am using cakephp 1.2.0.6311 and postgresql.

I get the error

 
*Warning* (2) <javascript:void(0);>: pg_query() [function.pg-query 
<http://php.net/function.pg-query>]: Query failed: ERROR:  invalid input syntax 
for integer: "" [*CORE/cake1.2/libs/model/datasources/dbo/dbo_postgres.php*, 
line *123*]

Code <javascript:void(0);> | Context <javascript:void(0);>

$sql    =       "INSERT INTO "time_zones" ("id","time_zone") VALUES 
('','Europe/Copenhagen')"


*Warning*: implode() [function.implode
<http://php.net/function.implode>]: Invalid arguments passed in
*/usr/share/php/cake1.2/libs/debugger.php* on line *497*

pg_query - [internal], line ??
DboPostgres::_execute() - 
CORE/cake1.2/libs/model/datasources/dbo/dbo_postgres.php, line 123
DboSource::execute() - CORE/cake1.2/libs/model/datasources/dbo_source.php, line 
155
DboSource::create() - CORE/cake1.2/libs/model/datasources/dbo_source.php, line 
499
Model::save() - CORE/cake1.2/libs/model/model.php, line 1220
UsersController::login() - APP/controllers/users_controller.php, line 58
Dispatcher::_invoke() - CORE/cake1.2/dispatcher.php, line 268
Dispatcher::dispatch() - CORE/cake1.2/dispatcher.php, line 240
[main] - APP/webroot/index.php, line 84

*Query:* INSERT INTO "time_zones" ("id","time_zone") VALUES
('','Europe/Copenhagen')

The problem is that id is defined as a postgresql serial type
which automatically generate a new id on insert.

 So, how does I stop cakephp from trying to insert '' into the id field ??



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to