[eluser]The Mask[/eluser]
Hi,
I have a combo control on my form holding titles (Mr, Mrs, Doctor etc). If a required title is not there, the user can enter a value in an <input> box and using ajax, it is saved with the combo control refreshed and defaulting to the new value entered.
When I write the new value, I use $this->db->insert_id() to obtain the new ID. I need this value to pass to a helper I have written that generates the HTML for the combo control so it knows which <option> to default to. Initially, I added a property $last_insert to my Title model (to temporarily store the last insert id) but this then assumed a column in my Title table existed and the save stopped working. To get around it, I created a dummy model that I could then reference in my view. E.g. $this->Dummy->last_insert. This works fine but is there a better way?
Thanks