简体   繁体   中英

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.

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:

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?

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:

Datatables Editable

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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