http://www.perlmonks.org?node_id=626761


in reply to sql queries updation improper

According to the table you show, every record has the same value for pid. As such, when you UPDATE ... WHERE pid=8000, every record is changed. Your program will set every color_image to some value, then set them all to some other value, etc. At the end of the loop, they'll all have the last value set.

What you need to do is write the WHERE clause so that each UPDATE affects only one record (or at least only the records you want to affect).