MySQL UPDATE Syntax
There may be a way around this by using MySQL's INSERT ... ON DUPLICATE KEY UPDATE syntax. I've used it in the past to perform bulk inserts/updates and is much faster than single queries. In your case, you'll want to make sure to pass in the primary key value so that it always invokes the "update" portion of the query instead of the "insert".
MySQL INSERT ... ON DUPLICATE KEY UPDATE Syntax
As far as I know, ZF doesn't support this out of the box (it's not standard SQL), but you should be able to add this into your own custom DB adapter.
--
Hector
On Wed, Aug 12, 2009 at 3:29 AM, PHPScriptor <contact@phpscriptor.com> wrote:
Ok in this example everything becomes the same. But in reality every row has
a different value...
View this message in context: http://www.nabble.com/update-more-rows-at-ones-tp24932410p24933724.html
Denis Baklikov wrote:
>
> Hi,
>
> Could you explain, why you update every row separately instead of using
> one
> SQL query to update all rows?
>
> Regards,
>
> Denis
>
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论