SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Feb 2010
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Update row in MySQL Database

    Hi,

    I want help on updating a row in a database.

    I want it so a user can go to this page, see the information already there (got that far) and then make the changes, click submit and then I want it to update this to the database (Haven't got that far and thats what I want help with).

    If anyone can help I will be very happy.

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    What part do you need help with?

    You construct an UPDATE query, a string, by placing the form data in the query. Then execute that query.

    Ex:
    PHP Code:
    $sql "UPDATE people SET name = '" mysql_real_escape_string($_POST['name']) . "' WHERE id = " . (int)$_POST['id'];
    mysql_query($sql); 
    You should ask this question in the forum for the language you're using if you need specific help.

  3. #3
    SitePoint Member mathbrick's Avatar
    Join Date
    Feb 2010
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Which programming language are you using?

  4. #4
    SitePoint Member
    Join Date
    Feb 2010
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Php


Tags for this Thread

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
  •