SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    865
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Updating multiple columns in a single query

    I get the following error when trying to run this query:

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set clicked = '0' WHERE clicked = 1 and alerts = 1' at line 1



    update searches set alerts = '0', set clicked = '0' WHERE clicked = '1' and alerts = '1';


    Any ideas? Thanks!
    Convert your dollars into silver coins. www.convert2silver.com

  2. #2
    SitePoint Member
    Join Date
    Dec 2010
    Location
    Silicon Valley
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You only have to declare SET once. Remove the second "set" and you should be good to go.


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
  •