I am getting error,
Query: SELECT COUNT(id) AS count FROM `clients` WHERE `id` = 81
Warning: SQL Error: 1054: Unknown column 'id' in 'field list'
in ...cake\libs\model\datasources\dbo_source.php on line 463
the primary key field name in database table is client_id.
On Jun 1, 12:43 pm, Repsah <[EMAIL PROTECTED]> wrote:
> which one is the edit function?
>
> If it's the second one try with
>
> $this->Client->id = $this->Session->read('client_id');
>
> before saving.
>
> On 6/1/07, cake_learner <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > When i try to update record, its inserting a new record.
>
> > I have a registration page, containing 6 pages. I am inserting the
> > data in same table. After the first page is saved, the insertid is
> > retrieved and stored in a session.
>
> > Code:
> > controller:
>
> > function index()
> > {
> > if(!empty($this->data['Client'])){
> > $this->Client->save($this->data);
> > $this->Session->write('client_id', $this->Client-
> > >id);
> > $this->redirect('/clients/register2');
> > }
>
> > function register2()
> > {
> > if(!empty($this->data['Client']))
> > {
> > $client_id=$this->Session->read('client_id');
> > $this->cleanupFields();
> > $this->Client->save($this->data);
> > }
> > }- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---