Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Cơ sở dữ liệu
PHP and MySQL Web Development - P111
Đang chuẩn bị liên kết để tải về tài liệu:
PHP and MySQL Web Development - P111
Cẩm Hạnh
67
5
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
PHP and MySQL Web Development - P111: 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. | 522 Chapter 25 Building a Shopping Cart Listing 25.2 Continued do_html_footer The script begins by including book_sc_fns.php the file that includes all the function libraries for this application. After that we must begin a session. This will be required for the shopping cart functionality to work. Every page in the site will use the session. There are some calls to HTML output functions such as do_html_header and do_html_footer both contained in output_fns.php . We also have some code that checks if the user is logged in as an administrator and gives her some different navigation options if she is we ll return to this in the section on the administration functions. The most important part of this script is get categories out of database cat_array get_categories display as links to cat pages display_categories cat_array The functions get_categories and display_categories are in the function libraries book_fns.php and output_fns.php respectively. The function get_ categories returns an array of the categories in the system which we then pass to display_categories . Let s look at the code for get_categories . It is shown in Listing 25.3. Listing 25.3 get_categories Function from book_fns.php Function That Retrieves a Category List from the Database function get_categories query database for a list of categories conn db_connect query select catid catname from categories result @mysql_query query if result return false num_cats @mysql_num_rows result if num_cats 0 return false result db_result_to_array result return result Implementing the Online Catalog 523 As you can see this function connects to the database and retrieves a list of all the category IDs and names.We have written and used a function called db_result_to_array located in db_fns.php. This function is shown in Listing 25.4. It takes a MySQL result identifier and returns a numerically indexed array of rows where each row is an associative array. Listing 25.4 db_result_to_array Function from db_fns.php .
TÀI LIỆU LIÊN QUAN
PHP and MySQL Web Development
Beginning PHP 6, Apache, MySQL 6 Web Development
www.it-ebooks.info .PHP & MySQL FOR ® Web Development ALL-IN-ONE DESK REFERENCE DUMmIES ‰ by Janet Valade with Tricia Ballad and Bill Ballad www.it-ebooks.info .www.it-ebooks.info .PHP & MySQL FOR ® Web Development ALL-IN-ONE DESK REFERENCE DU
ICT 5 Web Development - Chapter 6.1: Using MySQL with PHP
PHP & MySQL Web Development All-in-One Desk Reference For Dummies
Beginning PHP6, Apache, MySQL Web Development
Web Application Development with Yii and PHP
ICT 5 Web Development - Chapter 6.2: MySQL & PHP Advanced
BEGINNING PHP5.APACHE.MYSQL WEB DEVELOPMENT
PHP 5 e-commerce Development- P33PHP 5 e-commerce Development- P33
crossorigin="anonymous">
Đã 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.