I had the same type of problem and reported it as a bug. See the
change I made to the file below. It made my queries fly. The problem
is that the last_insert_id should return exactly ONE record according
to Mysql documentation. For some reason the cake coders decided to
return ALL changed record for LAST_INSERT_ID, which makes everything
really really slow for big associations/tables.
Gil Vidals
www.truepath.com
www.positionresearch.com
In file: dbo_mysql.php /*
$data = $this->fetchAll('SELECT LAST_INSERT_ID() as id From
'.$source); if ($data && isset($data[0]['id'])) {
return $data[0]['id'];
} */
Change To:
$data = $this->fetchArray('SELECT LAST_INSERT_ID() as id From
'.$source); if ($data && isset($data['id'])) {
return $data['id'];
}
On 12/14/06, gwoo <[EMAIL PROTECTED]> wrote:
>
> well, its hard to tell what you are doing. I guess it seems simple
> enough. Do you have DEBUG on 2 or 3. also, using pr($output); is
> usually a bit more efficient. With DEBUG on 2 you will see all the
> queries being produced so that really should be all you need 90% of the
> time.
>
>
> >
>
--
[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---