Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: sql queries updation improper

by kyle (Abbot)
on Jul 16, 2007 at 02:21 UTC ( #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).


Comment on Re: sql queries updation improper
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2014-11-27 21:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (188 votes), past polls