TAILIEUCHUNG - PHP and MySQL by Example- P16

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 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 . The admin_artlist .php page. Updating an Artist in the Gallery To get to the page the user clicked the hyperlink of an artist listed in the previous Figure A. 1. Line 4 of Example shows that the hyperlink is sending the id for that artist via a URL. The page Example 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 to remove this watermark. line 6 in Example . 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 . Code View php 1 extract _REQUEST 2 mysql_connect localhost root password or die .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.