SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard Darren884's Avatar
    Join Date
    Aug 2003
    Location
    Southern California, United States
    Posts
    1,616
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help With This Query

    UPDATE `top_site_users` SET out = out+1 WHERE user_id = '1' AND top_site_id = '1' AND id = '1'

    It has something to do with out = out + 1 I just can't grasp it. phpMyAdmin says its around that area.
    Have a good day.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,270
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    is there any chance that OUT might be a reserved word?

    try putting it in backticks -- this `escapes` it and treats it like an identifier, i.e. column name

    note that you do not need the backticks around top_site_users, because that isn't a reserved word, nor does it contain any special characters (the other reason that backticks are sometimes needed)


    oh, and by the way, please don't compare your numeric columns to strings

    change this --

    ... WHERE user_id = '1' AND top_site_id = '1' AND id = '1'

    to this --

    ... WHERE user_id = 1 AND top_site_id = 1 AND id = 1

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Wizard Darren884's Avatar
    Join Date
    Aug 2003
    Location
    Southern California, United States
    Posts
    1,616
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah thanks thats what I had forgotten
    Have a good day.


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
  •