This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
documents:cakephp_best_practice [2015/04/25 14:12] admin |
documents:cakephp_best_practice [2015/04/25 14:19] (current) admin |
||
---|---|---|---|
Line 2: | Line 2: | ||
=== 1. Save large record set === | === 1. Save large record set === | ||
+ | If we have to insert **<color green>large data</color>**, existed method saveAll() will be slow rather than core query. | ||
<PHP> | <PHP> | ||
Line 13: | Line 14: | ||
foreach ($data as $item) { | foreach ($data as $item) { | ||
if (empty($queryString)) { | if (empty($queryString)) { | ||
- | $queryString = "INSERT INTO `shipstations` ("; | + | $queryString = "INSERT INTO `tablename` ("; |
$columns = array(); | $columns = array(); | ||
$values = array(); | $values = array(); |