Hi,
I have a situation where I do not have id field for a table. This is
because it is a association table with many other fields and default
HABTM do not allow access to these extra fields. So I created a model
for that and using hasMany associations.
Now, when I try to save data for the association table, I get
last_insert_id error. Hence I am thinking to overwrite save function.
Related to this, I have two questions.
1. Is this the best solution or there is some way to avoid
last_insert_id error
2. How to save data. I mean, do I need to build sql command and save as
it is done in traidtional php way or CakePHP has some functionality to
do that. It will be great, If someone can provide an example of it.
Here is what I was trying within my model
function save( $data = null, $validate = true, $fieldList = array())
{
if(empty($data))
$this->flash('Invalid Information Provided');
//after this I am not sure what to do
}
Regards,
Ritesh
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---