This is a fully working SQL query.
INSERT INTO products
(id, company, title)
VALUES
(
'1',
'company1',
'title1'
),
(
'2',
'company2',
'title2'
)
ON DUPLICATE KEY UPDATE
id = VALUES(id),
company = VALUES(company),
title = VALUES(title)
When just dumping it in like this is probably very insecure.
db::query($sql);
- Is it possible to do this without
db::query
? - Should I add the values as the second or third argument? The docs says bindings as second argument and params as third argument. I could not find an example of it.
I guess this one is for you @lukasbestle.