www.webdeveloper.com
Results 1 to 3 of 3

Thread: UPDATE SET WHERE problem

  1. #1
    Join Date
    Jun 2009
    Location
    Cannock
    Posts
    30

    Angry UPDATE SET WHERE problem

    I'm trying to update a table set using php/mysql.

    The database is selected/logged on.

    I send this query and it doesn't work.

    UPDATE jjtanalytics_logs SET screenresolution='1280 x 1024', colourdepth='32 bit', pagetitle='Analytics Test', java='Supported', flash='10.0', WHERE ip='xxx.xxx.xxx.xxx' AND timestamp='1245433510' AND urlvisited='http://domain.tld/analytics/

    Please could anyone tell me what's wrong with it.

    Thanks,

    Ronnie268
    Failure isn't an option - It comes bundled with Windows

    π ~= 3.14
    3*14 = 42
    Coincidence? I think not.
    π = The Answer to Life, the Universe, and Everything.

  2. #2
    Join Date
    Aug 2005
    Location
    The Garden State
    Posts
    5,634
    remove the comma before the WHERE clause.
    Acceptable Use | SQL Forum FAQ | celery is tasteless | twitter

    celery is tasteless - currently needing some UI time

  3. #3
    Join Date
    Jun 2009
    Location
    Cannock
    Posts
    30
    Thanks - that worked brilliantly. BTW, I'd also forgotten to copy across the final ', so the query now looks like this:


    UPDATE jjtanalytics_logs SET screenresolution='1280 x 1024', colourdepth='32 bit', pagetitle='Analytics Test', java='Supported', flash='10.0' WHERE ip='xxx.xxx.xxx.xxx' AND timestamp='1245433510' AND urlvisited='http://domain.tld/analytics/'
    Failure isn't an option - It comes bundled with Windows

    π ~= 3.14
    3*14 = 42
    Coincidence? I think not.
    π = The Answer to Life, the Universe, and Everything.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles