foreach ($rows as $row) {
$db->insert_update(...);
}
I don't see any reason for doing this inside insert_update().
Jakub Vr�na
Jakub Vr�na
> The reason is performance. I will execute this query often and for
> high amount of rows.
>
Jakub Vr�na
> I am inserting words into a table, but I want have every word inserted
> only once (the word is the unique index of the table). Everytime an
> article is inserted into DB I need to update the words table. Article
> can have around 400 words. Now I use pure mySQL "INSERT ... ON
> DUPLICATE KEY UPDATE" query and it works, but it would be fine if the
> insert_update function could do the same.
>
I'm not going to implement it, use PDO for this task.
Jakub Vr�na
> Acually I don't need to update anything (I have "word_id = word_id" in
> the update statement), I only need to INSERT unique word into the
> table. I could use INSERT IGNORE instead or WHERE NOT EXISTS
> condition, but I think using ON DUPLICATE KEY is safer and faster.
>
$db->tags()->insert_multi($tags, true);