Prev | Current Page 644 | Next

W. Jason Gilmore

"Beginning PHP and MySQL: From Novice to Professional"

To modify this behavior, you can use the sqlite.
assoc_case directive. By default, this directive is set to 0, which retains the case used
in the table definitions. If it??™s set to 1, the names will be converted to uppercase. If it??™s
set to 2, the names will be converted to lowercase.
Opening a Connection
Before you can retrieve or manipulate any data located in an SQLite database, you
must first establish a connection. Two functions are available for doing so, sqlite_
open() and sqlite_popen().
Opening an SQLite Database
The sqlite_open() function opens an SQLite database, first creating the database if it
doesn??™t already exist. Its prototype follows:
resource sqlite_open(string filename [, int mode [, string &error_message]])
The filename parameter specifies the database name. The optional mode parameter
determines the access privilege level under which the database will be opened and is
572 CHAPTER 22 ?–  SQLITE
specified as an octal value (the default is 0666) as might be used to specify modes in
Unix. Currently, this parameter is unsupported by the API. The optional error_message
parameter is actually automatically assigned a value specifying an error if the database
cannot be opened. If the database is successfully opened, the function returns a
resource handle pointing to that database.
Consider an example:
$sqldb = sqlite_open("/home/book/22/corporate.


Pages:
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656