TAILIEUCHUNG - Beginning Zend Framework phần 6

Thiết lập thư mục hình ảnh chứa các hình ảnh để sử dụng cho CAPTCHA. Thiết lập đường dẫn hình ảnh để sử dụng cho CAPTCHA. Thiết lập các hậu tố tên tập tin hình ảnh (mặc định là png)loại xác thực, các loại Tên truy nhập, SSL sử dụng, mật khẩu, và số cổng để sử dụng. | CHAPTER 5 DATABASE COMMUNICATION MANIPULATION AND DISPLAY Deleting Records You ve learned how to save data to the database and you ve taken additional steps to fetch and display the data using the Zend Framework database modules but fetching and saving is only half the battle when it comes to web data. You need a way to delete data from the database. Deleting records from a table using SQL is a three-step process 1. Create a connection to the database. 2. Prepare the DELETE statement. 3. Execute the DELETE statement. Zend Framework allows you to do this by using the query method as when you composed the INSERT statement and then executed the code using the query method. Keeping to the theme of limiting the amount of SQL you need to write let s delete records without SQL. The delete method accepts two parameters. The initial parameter is a string and contains the name of the table on which you want to run the DELETE statement. The second optional parameter is a mixed type it can be either a string or an array. The string must contain a complete conditional statement that the record you plan to delete must meet for example username test_1 . If you need more than a single conditional statement use an array in which each element in the array represents a condition. If you omit the second parameter you allow the delete method to remove all the records from the table. When executing the method returns the total number of records that were affected. Listing 521 demonstrates the deletion process. Listing 5-21. Deleting Records Example- Delete Specific Account. public function testDeleteAction require_once Db db Db_Db conn try Delete the record with username testinguser9 AND status active conditions username testinguser9 conditions status active 192 Download at CHAPTER 5 DATABASE COMMUNICATION MANIPULATION AND DISPLAY Execute the query. results db- delete accounts conditions If the execution deleted 1 account then show success. if results 1 echo .

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.