$query = substr($query, 0, -2);\r
$query .= sprintf(' WHERE id=%u', $info['id']);\r
} else {\r
+ //The files table has hash and filename as a unique index.\r
+ //Some packs share the same banner for every file, and we only\r
+ //ever pull them out by hash. So this on duplicate thing saves\r
+ //having loads of entries\r
$query = sprintf('INSERT INTO %s (%s) VALUES (%s)',\r
$info['table'],\r
implode(', ', array_keys($info['columns'])),\r
- implode(', ', $info['columns']));\r
+ implode(', ', $info['columns'])) . ' ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id)';\r
}\r
-\r
- //The files table has hash and filename as a unique index.\r
- //Some packs share the same banner for every file, and we only\r
- //ever pull them out by hash. So this saves having loads of entries\r
- $queries[$index] = $query . ' ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id)';\r
+ \r
+ $queries[$index] = $query;\r
}\r
\r
// if($queries['TYPE'] == AbstractPopulationHelper::QUERY_TYPE_CREATE)\r