SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Texas
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sql query (again)

    Does anyone know the sql query to update a single row in a table? I know how to change an entire table with UPDATE, but I've never had to update just a single row before so I don't know how. Can anyone tell me? Thanks.
    Mark -
    www.magicscripts.net

  2. #2
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Throw a WHERE clause into your UPDATE query and match the primary key attribute to the value you are wanting to update. Eg

    UPDATE TABLE TableName
    SET foo='foo', bar='bar'
    WHERE primary_key = 123


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
  •