tailieunhanh - Drupal 7 First Look phần 8

uy định bởi PDO và chúng tôi sẽ thảo luận chi tiết hơn khi chúng tôi nhận được phần làm việc với các bộ kết lại này xác định những thông tin cần được trả lại sau khiMặc định, các dữ liệu cho mỗi hàng sẽ được đọc vào một đối tượng tương tự như việc sử dụngbản tuyên bố được thực hiện. | Chapter 6 fetch determines how data should be fetched from the result set. By default the data for each row will be read into an object similar to using db_fetch_object in Drupal 6. The available methods of fetching data are defined by PDO and we will discuss them all in more detail when we get to the section on working with result sets. return this option determines what information should be returned after the statement is executed. The default return type varies depending on the statement or query being executed. Options include Database RETURN_STATEMENT returns the statement containing all results so you can iterate and process all results. This is the default for queries and select statements. Database RETURN_AFFECTED returns the number of rows that were affected by the query. This is the default for update and delete statements. Database RETURN_INSERT_ID returns the ID of the row which was just inserted. Used with Insert statements. Database RETURN_NULL returns nothing. Useful when there is no meaningful data to return. throw_exception determines how exceptions are handled. This can be set to TRUE or FALSE. If it is set to TRUE the default any errors are logged and then rethrown so the calling code can handle it. If the option is set false the error will be silently ignored. Additional options may be available depending on the database driver you are using. To find a complete list of options that are available check the defaultOptions method of your driver. Saving query results to a temporary table Drupal gives you the option to save the results of a query into a temporary table which can improve performance for very complicated queries. The temporary table results are only available for the duration of the page request after which they are automatically deleted. The query will return the name of the temporary table that was created. This functionality is very similar to the Drupal 6 functionality of the same name however the method was changed to accept .

TỪ KHÓA LIÊN QUAN