Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: sql queries updation improper

by kyle (Abbot)
on Jul 16, 2007 at 02:21 UTC ( [id://626761]=note: print w/replies, xml ) Need Help??


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).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://626761]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-03-28 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found