TAILIEUCHUNG - PHP and MySQL Web Development - P102

PHP and MySQL Web Development - P102: PHP and MySQL Web Development teaches the reader to develop dynamic, secure, commercial Web sites. Using the same accessible, popular teaching style of the first edition, this best-selling book has been updated to reflect the rapidly changing landscape of MySQL and PHP. | Implementing the Database 477 We will begin by implementing the MySQL database for this application as it will be required for virtually all the other functionality to work. Then we will work through the code in the order it was written starting from the front page going through the user authentication to bookmark storage and retrieval and finally to order is fairly logical it s just a question of working out the dependencies and building first the things that will be required for later modules. Note For the code in this project to work as written you will need to have switched on magic quotes. If you have not done this then you will need to addslashes to data being inserted to the MySQL database and stripslashes from data retrieved from the database. We have used this as a useful shortcut. Implementing the Database We only require a fairly simple schema for the PHPBookmark need to store users and their email addresses and also need to store the URL of a bookmark. One user can have many bookmarks and many users can register the same therefore have two tables user and bookmark as shown in Figure . user username passwd email laura 7cbf26201e73c29b laura@ luke 1fef10690eeb2e59 luke@ bookmark username bm_URL laura laura http http Figure Database schema for the PHPBookmark system. The user table will store the user s username which is the primary key password and email address. The bookmark table will store username and bookmark bm_URL pairs. The username in this table will refer back to a username from the user table. The SQL to create this database and to create a user for connecting to the database from the Web is shown in Listing should edit it if you plan to use it on your system change the user s password to something more secure 478 Chapter 24 Building User Authentication and Personalization Listing SQL File to Set

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.