Đang chuẩn bị liên kết để tải về tài liệu:
PHP and MySQL by Example- P16

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Tham khảo tài liệu 'php and mysql by example- p16', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 4 After extracting the records with the mysqi_fetch_assoc function a table is displayed with links to each artist his or her phone number and e-mail address and a Delete hyperlink. If the user clicks the hyperlink with the artist s name the artist s id will be passed to the admin_artist_edit.php script via a URL. The value of the id is appended to the after the link. 5 The Delete link when clicked passes the action value and the id of the artist to the PHP script line 1 . Figure A.l. The admin_artlist .php page. Updating an Artist in the Gallery admin_artist_edit.php To get to the admin_artist_edit.php page the user clicked the hyperlink of an artist listed in the previous Figure A. 1. Line 4 of Example A.1 shows that the hyperlink is sending the id for that artist via a URL. The admin_artist_edit.php page Example A.2 uses the id to determine which artist to update. You can see the value of the id in the URL because the GET method is being used . The id for the artist is stored in a hidden field see Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. line 6 in Example A.2 . If this is the first time the page is displayed a SQL SELECT statement see line 5 is executed to retrieve all the data for that artist from the database. The user is presented with a self-processing HTML form containing the artist information such as the name e-mail address phone and so on for the particular artist he or she selected for update. Once the user has updated the information in the form it is passed into the PHP portion of the page and extracted from the _REQUEST superglobal array see line 1 The variables resulting from the extract function are used to SET the new values for the artist in the SQL UPDATE command on line 3. Be sure when you test this script that you update line 2 and provide the correct server username and password to connect to your version of MySQL. Example A.2. Code View php 1 extract _REQUEST 2 mysql_connect localhost root password or die .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.