SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Mar 2011
    Location
    Manchester, UK
    Posts
    226
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Will Not UPDATE :(

    Code:
    UPDATE affpixels SET Pixel ='loudnewmedia.com' AND AffID ='3' AND ProID ='2' WHERE PixelID ='2'
    Why wont the fields update? When i run the above Query it says 0 rows affected

    So why wont it update? PixelID = 2 exists.

    Code:
    0 rows affected. ( Query took 0.0004 sec )
    Any help would be great.
    You're Help Does Not Go Unnoticed, I have So Far Donated 25 GBP
    To Cancer Research UK As A Thank You To All The SitePoint
    Members That Have Helped Me In The PHP Forum Thank You!

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,275
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    interesting that it actually ran

    the ANDs are wrong, they should be commas -- check da syntax in da manuals
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,246
    Mentioned
    240 Post(s)
    Tagged
    1 Thread(s)
    Rudy is right. There should be commas there, and not ANDS. You would use ANDS with the conditions, the WHERE part, if you had more than one condition to met AND these additional conditions needed to be met in addition to the first.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •