Does anybody know how to amend/update data by php form


Does anybody know how to amend data by php form choosing the row via a drop down list?

I need to create an amend/update php form which fetches the a series of fields stored in a mysql database so that it can be edited to update records stored in the database.

Yes, I know how to do this.

I know how to select the the table by using a drop down list of the with the name field, but I would like to know how do I bring the text up into a form which can be edited and re-submitted.


Well, you cannot expect us to cook your scripts for you (they’re far too personal for that ;)). I’m sure you have basic knowledge of using PHP in conjunction with MySQL:

use ‘SELECT’ to fetch the data from the database.
use ‘echo’ to print it on the screen/textarea/input box.

use ‘$_POST’ to fetch the submitted data.
make sure you parse all unwanted characters (think SQL Injection).
use ‘UPDATE’ to return the data into the database.

I appreciate your comment which is very true I cannot expect you to cook your scripts for me. I have two books on php and been on a course. The problem lies in the fact that I always want to do more than the book or go further than the course and I see pages such as this page that I am on with wysiwg box and of course I want to know how to achieve this. When I go on myspace or musicforte, I edit my profile and there is the my text that I can edit and I want to learn how to do that also.

I am only six months into learning php and do this in my spare time which is limited after doing a 50 hour week, but believe me I am trying to learn.

Can you recommend a book that would teach me how to acheive the above?

I have spent weeks looking at examples of code, before coming cap in hand to the forum. I have looked at many examples of forms but none had the result I requred.

Now that you have provided me with the phrase echo to input box, hopefully I will find an example.

Many thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service