开发者

creating a table in php which has edit functionality

开发者 https://www.devze.com 2023-01-31 02:44 出处:网络
I have a table which displays the values from a MySQL table. I need to add edit functionality to it using PHP. I have an input form which posts data to the table usin开发者_JAVA百科g $_GET[\'term\'].

I have a table which displays the values from a MySQL table. I need to add edit functionality to it using PHP. I have an input form which posts data to the table usin开发者_JAVA百科g $_GET['term']. How can i add the edit link to each record in the table so that it will redirect to the input form with the values populated?

I think we can use $_GET method here but am not sure how. Any ideas?


Add an edit link like this:

<a href="/path/to/input-form.php?id=<?php echo $row['ID']; ?>">edit</a>

where id is the id of the database entry.

This will take you to the form, and you can use a mysql call to populate the fields based on the id passed using $_GET['id']

0

精彩评论

暂无评论...
验证码 换一张
取 消