PHP link MYSQL edit question xx. php? Id = 123 & nbsp; here, the related values in SQL are opened, and the original values are displayed. & nbsp; then you can edit & nbsp; and save it to the original ID, how to write such a PHP page. I thought about the PHP link MYSQL editing problem for a long time.
Xx. php? Id = 123
Here, we will open the related values in SQL, display the original values in them, and then edit and save them to the original ID. how can we write such a PHP page. I thought about it for a long time.
------ Solution --------------------
Query display and modification must be completed separately
Query
$ Link = @ mysql_connect (LOCALLHOST, USER, PASS) or die ('database connection failed! ');
Mysql_select_db (DBNAME, $ link );
Mysql_query ('set name gb2312 ');
$ SQL = "select * from table name ";
$ Result = mysql_query ($ SQL, $ link );
Echo'
';
While ($ row = mysql_fetch_assoc ($ result )){
Echo'';
Echo''. $ Row ['id'].'';
......
Echo'';
}
Echo'';
Mysql_free_result ($ result );
Mysql_close ($ link );
Modify
On the form page, upload the ID of the data you want to modify to the editing page, click "modify" on the editing page, and then upload it to the dynamic page (perform the above operations to connect to the database and perform modifications)