简体   繁体   English

如何编辑“ PHP-MySQL返回的” HTML表并在数据库上对其进行更新

[英]How to edit a “PHP-MySQL-returned” HTML table and update it on the database

I have a simple PHP code to retrieve data from MySQL database table. 我有一个简单的PHP代码,可从MySQL数据库表检索数据。 After this HTML table is displayed, I want to edit certain fields so that they are updated on the database. 显示此HTML表之后,我要编辑某些字段,以便在数据库上更新它们。

Please tell me as to what and how to do. 请告诉我什么以及如何做。

Thanks. 谢谢。

Have the retrieved data go into form fields like this: 让检索到的数据进入这样的表单字段:

<input type='text' name='age' value='<?php echo $age; ?>'>

This way, the form is pre-filled with the listing data. 通过这种方式,表单将使用列表数据预先填充。 Also, on the page the form goes to, have that data (which comes to it via $_POST) written back into the database. 同样,在表单转到的页面上,将数据(通过$ _POST传到数据库中)写回到数据库中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM