hey guys i've tried to run this query on my database but it only partially works...the images paths will change but the values for cover won't budge
table
---------------------
item_id
path - varchar
cover - int(1)
--------------------
cover will be 1 or 0 depending if the image is the main image.
i can see anything i'm doing wrong here...can someone please shine some light on why both path and cover values are not swapping.
here is my sql:
UPDATE item_images im1, item_images im2
SET im1.cover = im2.cover,
im2.cover = im1.cover,
im1.path = im2.path,
im2.path = im1.path
WHERE im1.item_id = im2.item_id
AND im1.path = '1447700522.jpg'
AND im2.path = '1447700481.jpg'
AND im1.item_id = 58
thank you