Help update MySQL database

Discussion in 'MySQL' started by rhoula, Mar 11, 2014.

  1. #1
    Hi everyone can someone please help me with a php script.

    I need a form that I can use to update a MySQL database.

    The table name is "menus"
    there are 3 fields in the database:
    id
    Menu_Name
    menu_link

    Someone please help me. I would be very grateful.

    Thank you
     
    rhoula, Mar 11, 2014 IP
  2. navin.kduggal

    navin.kduggal Greenhorn

    Messages:
    1
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    23
    #2
    <?php
    $query='UPDATE menus SET id="'.$id.'",menu_name="'.$menu_name.'",menu_link="'.$menu_link.'" ';
    mysql_query($query);
    ?>

    where $id,$menu_name,$menu_link are field name of your form
     
    navin.kduggal, May 2, 2014 IP
    rhoula likes this.
  3. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #3
    An update-query without a WHERE-clause tends to fuck up more than it solves, though...
     
    PoPSiCLe, May 4, 2014 IP