Update db via a php/html form

2 replies
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?

Thank you in advance!
#form #php or html #update
  • Profile picture of the author maxmalini
    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
    {{ DiscussionBoard.errors[4354236].message }}
  • Profile picture of the author Workman
    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;
    {{ DiscussionBoard.errors[4354633].message }}

Trending Topics