Been looking around the web for a while now and don\'t seem to be able to come across anything similar to what I want. I know it\'s something to do with the way I\'m writing
Thanks to all the help from those above the solution I found in the end was very close to both. Find it below:
INSERT INTO `stock`
(name, barcode, item, quantity, location, price, date)
VALUES
(?,?,?,?,?,?,?)
ON DUPLICATE KEY UPDATE
quantity = CASE WHEN
VALUES(date) < $date
THEN quantity + $quantity
ELSE quantity
END,
date = CASE WHEN
VALUES(date) < $date
THEN VALUES(date)
ELSE $date
END