[英]SQL Table Hyperlink to Edit row data using php, possible?
I need to set up an online form to edit a MySQL database using PHP. 我需要设置一个在线表单来使用PHP编辑MySQL数据库。
I was hoping to set up a default column in each row of the table with a hyperlink which will take you to the editing form (web page), and in the process, pre-fill the data from the row in which you click 'edit' on. 我希望在表的每一行中使用超链接设置一个默认列,该超链接会将您带到编辑表单(网页),然后在此过程中,单击“编辑”的行中的数据预先填充' 上。
For example the My SQL Table: 例如我的SQL表:
CREATE TABLE x (
UserID int(10) NOT NULL AUTO_INCREMENT,
Name varchar(40),
Email varchar (50),
key UserID (UserID),
EditDetails VARCHAR (250) NOT NULL DEFAULT '<a href= http://webpage.with.wdit.form> Edit</a>;
)
Another page will be set up to allow you to view all the details in the table. 将设置另一个页面,使您可以查看表中的所有详细信息。
Does anyone have any ideas how I could make it so that if you click on the 'edit' hyperlink in the last column, you would get taken to the editing web page and a php script will run to prefill the form with the details from the row you are wanting to edit? 有谁知道我该怎么做,所以如果您单击最后一列中的“编辑”超链接,您将被带到编辑网页,并且将运行一个php脚本以使用来自您要编辑的行?
This is a common method and there are lots of tutorials out there on the web to help you with this. 这是一种常见的方法,网络上有很多教程可以帮助您。
Couple of them: 其中几个:
Example one 例子一
Example Two 例子二
And for inline editing, you can use this plugin: 对于内联编辑,您可以使用以下插件:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.