How i can edit data of mysql?

I make a form in (dreamweaver) with php and html. I fill the form with the data and insert in my mysql database(wich is on a server).

But now I want to edit the data that i already insert. Send me some scripts

4 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    ok, really HIGH level pseudo code......

    *create a form that will submit values to search for

    *the retrieved data will come back to a form SIMILAR if not the same as your entry form

    *Edit the data and post it back.......this is where it gets tricky.....

    ***you need to hold some data in a hidden HTML form field so you can re-find the data that is in your form......

    **instead of doing and insert you UPDATE.....look up SQL UPDATE if you are unsure.

    ***Post back the original and changed data in a confirmation page and provide a link back to somewhere......

    It's a good learning experience and a little help can go a long way.......try it and come back with more questions if you need to

  • 1 decade ago

    You use the UPDATE SQL statement, outlined here:

    http://dev.mysql.com/doc/refman/5.0/en/update.html

    Here's the PHP manual page on mysql_query():

    http://ca.php.net/manual/en/function.mysql-query.p...

  • Andy T
    Lv 7
    1 decade ago

    Isn't it the update SQL syntax?

  • 1 decade ago

    $value1 = $_GET['value1'];

    $value2 = $_GET['value2'];

    $sql = "UPDATE table SET value1 = '$value1' WHERE value2 = '$value2'";

    mysql_query($sql);

Still have questions? Get your answers by asking now.