Web server - CHAPTER 22 SQLITE Name: Jason Gilmore (Employee
CHAPTER 22 SQLITE Name: Jason Gilmore (Employee ID: 1) Name: Sam Spade (Employee ID: 2) Name: Ray Fox (Employee ID: 3) Keep in mind that sqlite_query() will only execute the query and return a result set (if one is warranted); it will not output or offer any additional information regarding the returned data. To obtain such information, you need to pass the result set into one or several other functions, all of which are introduced in the following sections. Furthermore, sqlite_query() is not limited to executing SELECT queries. You can use this function to execute any supported SQL-92 query. sqlite_unbuffered_query() resource sqlite_unbuffered_query (resource dbh, string query) The sqlite_unbuffered_query() function can be thought of as an optimized version of sqlite_query(), identical in every way except that it returns the result set in a format intended to be used in the order in which it is returned, without any need to search or navigate it in any other way. This function is particularly useful if you re solely interested in dumping a result set to output, an HTML table or a text file, for example. Because this function is optimized for returning result sets intended to be output in a straightforward fashion, you cannot pass its output to functions like sqlite_num_rows(), sqlite_seek(), or any other function with the purpose of examining or modifying the output or output pointers. If you require the use of such functions, use sqlite_query() to retrieve the result set instead. sqlite_last_insert_rowid() int sqlite_last_insert_rowid (resource dbh) It s common to reference a newly inserted row immediately after the insertion is completed, which in many cases is accomplished by referencing the row s auto-increment field. Because this value will contain the highest integer value for the field, determining it is as simple as searching for the column s maximum value. The function sqlite_last_insert_rowid() accomplishes this for you, returning that value. Parsing Result Sets Once a result set has been returned, you ll likely want to do something with the data. The functions in this section demonstrate the many ways that you can parse the result set. sqlite_fetch_array() array sqlite_fetch_array (resource result [, int result_type [, bool decode_binary]) The sqlite_fetch_array() function returns an associative array consisting of the items found in the resultset s next available row, or returns FALSE if no more rows are available. The optional result_type parameter can be used to specify whether the columns found in the result set row
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.