PHP + MYSQL Difficulties

Discussion in 'OT Technology' started by Sexual Vanilla, Oct 19, 2006.

  1. Sexual Vanilla

    Sexual Vanilla New Member

    Joined:
    May 23, 2005
    Messages:
    6,305
    Likes Received:
    0
    Location:
    South Carolina
    Hello guys,
    I'm having some problems updating a MYSQL database using PHP. Essentially, I am supplying the "id" of the record I would like to edit, then filling in the values contained in the column in an html form. The user can then edit the fields and click update. The form properly displays the values. The only problem is that "update" does nothing. "Band Updated" is displayed, but the row remains the same after the "update." Any ideas?

    Code:
     
  2. Conrad10781

    Conrad10781 New Member

    Joined:
    Feb 26, 2005
    Messages:
    45
    Likes Received:
    0
    Location:
    New York
    I know this may sound funny but what happens if you remove your space before the UPDATE in " UPDATE... Also if that doesn't work are you getting any sort of error?
     
  3. Coottie

    Coottie BOOMER......SOONER OT Supporter

    Joined:
    Jun 6, 2006
    Messages:
    32,407
    Likes Received:
    0
    Location:
    OKC
    You have unmatched parenthesis here:

    Code:
    $SQL = " UPDATE bandsite.bands SET (bandid = '$id', bandname = '$bandname', username = '$username', location = '$location', state = '$state', bio = '$bio' WHERE bandid ='$id'";
     
  4. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,575
    Likes Received:
    2
    dot.


    What IDE do you use? A good one would have caught that. I suggest PHPEdit. (I use 2.6.1.3521)
     
  5. Sexual Vanilla

    Sexual Vanilla New Member

    Joined:
    May 23, 2005
    Messages:
    6,305
    Likes Received:
    0
    Location:
    South Carolina
    Thanks for the advice guys...upon further examination of the parenthesis in question, it turns out that I do not need them to begin with. In answer to the IDE question, I use Textpad. :dunno:

    Thanks again! :bigthumb::bowdown:
     

Share This Page