Code for 'edit form' using Php and MySQL ..please? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Code for 'edit form' using Php and MySQL ..please?

can someone show me step by step process of how to make a edit form using php and mysql

25th Apr 2017, 5:37 AM
Trinugh
Trinugh - avatar
3 Answers
+ 5
Edit what? Entries in the database? make a list of the entries and link them to your edit form. fill the fields with the data of the selected entry. after submitting use the update statement on the selected entry with the edited values. is that what you want to do?
25th Apr 2017, 5:48 AM
Mario L.
Mario L. - avatar
+ 2
Are you talking about editing a user detail on ur site.. or a forum post..?? ..any of which u could just create your form and create the input for the entries which you want to be edited on the database.. ..use your normal if(isset($_POST).. Or any other depending on the forn method you used to get user inputted details.. ..verify them.. e.g.. if(empty($Data)), or verify for specific data types so as to skip some sql errors.. e.g.. for INT.. you would need: if(!is_numeric($int)).. or other possible methods.. .. when done with input verification go ahead and use update statement to update(edit) the former entry in the database or table.. E.G UPDATE users SET username='codefreak', hobby='coding' WHERE uid = 2; ..you could edit and set your own values with user interaction using the roughly described method above 👆 ..hope its Helpful.. ☺
25th Apr 2017, 6:16 AM
W͛onderB͛oy (◣_◢)
W͛onderB͛oy (◣_◢) - avatar
+ 1
This is a single page form submit to Mysql code.. (due to not db access on Code Playground, you will get fatal error msg if you run it there) https://code.sololearn.com/wRG5Cck4ilU4
25th Apr 2017, 8:02 AM
Calviղ
Calviղ - avatar