#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    15
    Rep Power
    0
    Could somebody please help me with this problem. I want to create an admin page so people can edit data in a MySQL database. I have read all the tutorials i can find but none of them go into using the UPDATE function. I have tried using the coding below and although i receive no parse errors the database is not being updated. Am I using the incorrect syntax?

    mysql_connect($DBHost,$DBUserName,$DBPassword) or die("server");
    @mysql_select_db("xxxxxxx") or die("db");
    $result = mysql_query("update news_stories set type="$type" body="$body" email="$email" uname="$uname" headline="$headline" where id=$id");
    mysql_close();

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    Annapolis, Maryland US
    Posts
    113
    Rep Power
    15
    Use commas between the assignments in your update query

    ... SET col1='$val1', col2='$val2', ...

Similar Threads

  1. Newbie table creation question
    By andy collins in forum PostgreSQL Help
    Replies: 3
    Last Post: January 23rd, 2004, 02:27 PM
  2. ok super newbie question
    By SCerviche in forum Flash Help
    Replies: 5
    Last Post: January 11th, 2004, 02:29 PM
  3. newbie question
    By lottidah in forum .Net Development
    Replies: 2
    Last Post: December 8th, 2003, 02:11 PM
  4. newbie question on install
    By iwanaa in forum PHP Development
    Replies: 4
    Last Post: November 25th, 2003, 08:02 PM
  5. basic syntax - newbie question
    By davidgraham16 in forum PHP Development
    Replies: 1
    Last Post: November 23rd, 2003, 09:26 AM

IMN logo majestic logo threadwatch logo seochat tools logo