Re: Editing ID

2011-05-27 Thread euromark
what exactly is the result? does it validate? or does it still create a new record (which i doubt if you added the id)? On 27 Mai, 11:37, thom wrote: > On Fri, May 27, 2011 at 2:11 PM, euromark wrote: > > updateAll is usually NOT for unsecured user input > > its for atomic queries and multiple c

Re: Editing ID

2011-05-27 Thread thom
On Fri, May 27, 2011 at 2:11 PM, euromark wrote: > updateAll is usually NOT for unsecured user input > its for atomic queries and multiple changes mainly > > but if you use it for user input you have to secure your data of > course (manually!) > > PS: > all you needed was to add the id to the data

Re: Editing ID

2011-05-27 Thread euromark
updateAll is usually NOT for unsecured user input its for atomic queries and multiple changes mainly but if you use it for user input you have to secure your data of course (manually!) PS: all you needed was to add the id to the data array this->data['Poscheck']['id'] = $id; $save = $this

Re: Editing ID

2011-05-27 Thread thom
On Fri, May 27, 2011 at 12:03 PM, Dr. Loboto wrote: > If you want to update ID of record you must use saveField() or > updateAll() method. > Thankyou for your help, Dr Loboto.. It works. It's kinda strange because 'The $fields array accepts SQL expressions. Literal values should be quoted manuall

Re: Editing ID

2011-05-26 Thread Dr. Loboto
If you want to update ID of record you must use saveField() or updateAll() method. Cake checks if record exists to determine if INSERT of UPDATE query is needed for save() or saveAll() call. New ID in data takes precedence over ID you set directly. So Cake don't find record with new ID and assumes

Editing ID

2011-05-26 Thread thom
Hello,, I am trying to edit the ID of a record. But what I got is cake make a new record (add/ insert not updating the record). How could I add 'WHERE' clause in save()? I've added were $this->Poscheck->id = $this->data['Poscheck']['old_id']; $save