Update db via a php/html form

by 2 replies
3
#programming #form #php or html #update
  • Hi,

    What you are looking for is the UPDATE function for your database. An Edit is really an Update function in DB terms. Here's a link that may shed some more light:

    PHP MySQL Update

    - Max
  • A simple database table, comments:
    id (autoincrementing primary_key)
    name (varchar 100)
    email (varchar 255)
    comment (text)

    Adding a record using Insert:
    INSERT INTO comments VALUES (name="John Doe",email="jdoe@gmail.com",comment="Hello there!");
    // Perhaps creates a new record with the id of 1

    Updating the record using Update:
    UPDATE comments SET (name="Jane Doe",comment="Hello world!") WHERE id = 1;

    Removing the record using DELETE:
    DELETE FROM comments WHERE id = 1;

Next Topics on Trending Feed

  • 3

    Hello to everyone! I need a mode to modify (edit) and update the db via a php/html form. I have now a mode to insert and delete form but i don;t know how to proceed for a update form. Can someone help me please?