News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Eran Galperin's Blog:
Multiple row operations in MySQL / PHP
May 14, 2009 @ 09:35:35

Eran Galperin has made a recent post about performing multiple row operations in MySQL - inserts and updates.

Multiple row operations are in common use in a normalized application databases as one database entity is often linked to multiple sub-entities (for example a user and his tags). [...] Too often I've seen such queries ran in long loops one at a time, which is very bad for performance (as I will show here) and sometimes equally bad for integrity (if the process is interrupted). So what are the alternatives?

His alternatives include concatenation of values for an insert (rather than looping) and updating the information with a "ON DUPLICATE KEY UPDATE" statement or, for multiple tables, using a join.

0 comments voice your opinion now!
tutorial insert update mysql


blog comments powered by Disqus

Similar Posts

PHPBuilder.com: Building an Error-Handling Mechanism

DZone.com: MySQL PHP search: four-part video tutorial series

Ibuildings techPortal: DPCRadio: Working with Zend_Form

ZendCasts.com: RESTful Delete with SLIM, jQuery and JSON

Zend Developer Zone: Working with RAR, LZF and BZ2 Compression Formats in PHP


Community Events





Don't see your event here?
Let us know!


framework voicesoftheelephpant release tips series code threedevsandamaybe deployment podcast bugfix conference language laravel symfony introduction zendserver community api interview list

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework