My table has data like so
products_parent_id | products_quantity
2 5
2 7
2 9
2 4
My SQL statement looks like so (so far):
UPDATE ' . TABLE_PRODUCTS . ' SET products_quantity = products_quantity +' . $order['products_quantity'] . ', products_ordered = products_ordered - ' . $order['products_quantity'] . ' WHERE products_parent_id = ' . (int)$order['products_id']
Now what I want to do, is update only say the 3rd occurrence of products_parent_id (in this case, 3rd from the top is 9)
To SELECT the 3rd occurrence, I used this at the end of my statements LIMIT($grade, 1)
Is there a way to UPDATE using MySQL but only the 3rd/4th/etc occurrence? Will it be reliable?
Thank you