Hi, I am new to cake php, i am using postgres db, i don't have any permissions to change the db. when i am creating the register page the following error was shown , i wrote code like this.
This is my table in db -------------------------------- Table "public.tbluser" Column | Type | Modifiers ----------------+------------------------+--------------------------------------------------------------------- lnguser | integer | not null default nextval(('"tbluser_lnguser_seq"'::text)::regclass) strfname | character varying(100) | not null strlname | character varying(100) | not null struid | character varying(100) | not null strpid | character varying(100) | not null lnguser_group | integer | not null strtelarea | character varying(20) | strtelno | character varying(20) | stremail | character varying(100) | struserconfirm | character varying(100) | dtmregistered | date | dtmapproved | date | blnchatuser | bit(1) | Indexes: "tbluser_pkey" PRIMARY KEY, btree (lnguser) ------------------------------------------------ register.ctp --------------------- <h2>Create an Account</h2> <?php echo $form->create('Tbluser', array('controller' => 'tblusers', 'action' => 'register')); echo $form->input('strfname', array('type' => 'text', 'label' => 'First Name :')); echo $form->input('strlname', array('type' => 'text', 'label' => 'Last Name :')); echo $form->input('struid', array('type' => 'text', 'label' => 'User Name :')); echo $form->input('strpid', array('type' => 'password', 'label' => 'Password :')); echo $form->input('stremail', array('type' => 'text', 'label' => 'Email :')); echo $form->hidden('lnguser_group', array('value' => 13)); echo $form->submit('Create Account'); echo $form->end(); ?> ----------------------------------------------------------- register method in controller ------------------------------------------ function register() { // If the user submitted the form… if (!empty($this->data)) { // echo $strpid=$this->data['Tbluser']['strpid']; $this->Tbluser->create(); $this->Tbluser->save($this->data); $this->redirect(array('action' => 'login')); } } --------------------------------------------------------------------------------------- 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: "nextval(('"tbluser_lnguser_seq"'" [*CORE/cake/libs/model/datasources/dbo/dbo_postgres.php*, line *155*] *Warning* (512) <javascript:void(0);>: *SQL Error:* ERROR: invalid input syntax for integer: "nextval(('"tbluser_lnguser_seq"'" [*CORE/cake/libs/model/datasources/dbo_source.php*, line *526*] Code <javascript:void(0);> | Context <javascript:void(0);> $sql = "INSERT INTO "tbluser" ("lnguser", "strfname", "strlname", "struid", "strpid", "stremail", "lnguser_group") VALUES ('nextval((''"tbluser_lnguser_seq"''', 'satya', 'satya', 'satya', '2768113314c97c6bdb22c8ce5c1c74b14c1b5462', 'satya', '1')" $error = "ERROR: invalid input syntax for integer: "nextval(('"tbluser_lnguser_seq"'"" $out = null $out = null; if ($error) { trigger_error("<span style = \"color:Red;text-align:left\"><b>SQL Error:</b> {$this->error}</span>", E_USER_WARNING); DboSource::showQuery() - CORE/cake/libs/model/datasources/dbo_source.php, line 526 DboSource::execute() - CORE/cake/libs/model/datasources/dbo_source.php, line 202 DboSource::create() - CORE/cake/libs/model/datasources/dbo_source.php, line 586 Model::save() - CORE/cake/libs/model/model.php, line 1287 TblusersController::register() - APP/controllers/tblusers_controller.php, line 40 Object::dispatchMethod() - CORE/cake/libs/object.php, line 115 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 226 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193 [main] - APP/webroot/index.php, line 87 *Query:* INSERT INTO "tbluser" ("lnguser", "strfname", "strlname", "struid", "strpid", "stremail", "lnguser_group") VALUES ('nextval((''"tbluser_lnguser_seq"''', 'satya', 'satya', 'satya', '2768113314c97c6bdb22c8ce5c1c74b14c1b5462', 'satya', '1') *Warning* (2) <javascript:void(0);>: Cannot modify header information - headers already sent by (output started at /var/www/wizard_auth/cake/basics.php:108) [*CORE/cake/libs/controller/controller.php*, line *646*] Please any one can help me out how to solove this problem...! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en