TAILIEUCHUNG - PHP and MySQL Web Development - P147

PHP and MySQL Web Development - P147: 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. | 702 Chapter 29 Building Web Forums Listing Continued check not a duplicate query select from header body where and . post parent . and . post poster . and . post title . and . post area . and . post message . result mysql_query query if result return false if mysql_numrows result 0 return mysql_result result 0 0 query insert into header values . post parent . . post poster . . post title . 0 . post area . now NULL result mysql_query query if result return false note that our parent now has a child query update header set children 1 where postid . post parent result mysql_query query if result return false find our post id note that there could be multiple headers that are the same except for id and probably posted time query select from header left join body on where parent . post parent . Extensions 703 Listing Continued and poster . post poster . and title . post title . and is NULL result mysql_query query if result return false if mysql_numrows result 0 id mysql_result result 0 0 if id query insert into body values id . post message . result mysql_query query if result return false return id This is a long function but it is not overly complex. It is only long because inserting a posting means inserting entries in the header and body tables and updating the parent article s row in the header table to show that it now has children. That is the end of the code for the Web forum application. Extensions There are many extensions you could add to this project You could add navigation to the view options so that from a post you could navigate to the next message the previous message the next-in-thread message or the previous-in-thread message. You could add an administration interface for setting up new forums and deleting old posts. You could add user authentication so only registered users could .

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.