Forum Moderators: coopster

Message Too Old, No Replies

editing data from the database using php

         

Myrnalyn

1:25 pm on Mar 15, 2008 (gmt 0)

10+ Year Member



Hi all,

in my form i was able to save data to the database and i can also update and delete on it, but i was not able to edit data from the database. all i want to do id after i can update data i will edit it and then save it again to the database.

what should i do in order to edit my data from the database...please help me ....i am glad to accept all your great ideas.thank you

Habtom

5:26 am on Mar 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to pull out the existing data from the database to a form, where you can modify and run an update sql statement to update the existing data in your database. You will need a unqiue Id to udpate a single row in the database written in the where clause of the sql statement.

Your SQL statement should look like this:

UPDATE yourtable SET name = $name, age = $age WHERE id = $id;