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 .