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 sqlite_
last_insert_rowid() function accomplishes this for you, returning that value. Its
prototype follows:
int sqlite_last_insert_rowid(resource dbh)
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.
Returning the Result Set As an Associative Array
The sqlite_fetch_array() function returns an associative array consisting of the
items found in the result set??™s next available row, or returns FALSE if no more rows are
available. Its prototype follows:
array sqlite_fetch_array(resource result [, int result_type [, bool
decode_binary])
The optional result_type parameter can be used to specify whether the columns
found in the result set row should be referenced by their integer-based position in
the row or by their actual name. Specifying SQLITE_NUM enables the former, while
SQLITE_ASSOC enables the latter. You can return both referential indexes by specifying
SQLITE_BOTH. Finally, the optional decode_binary parameter determines whether
PHP will decode the binary-encoded target data that had been previously encoded using
the function sqlite_escape_string(). This function is introduced in the later section
???Working with Binary Data.
Pages:
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662