Online
 
Thursday, 20 November 2008
 
 

Odds and Ends | Print |  E-Mail
 

Now that you have been introduced to all the day-to-day functions you'll use when working with SQLite, the following is a collection of functions that more or less stand on their own. The first of these functions relates back to the beginning of the chapter when I discussed how SQLite handles locking during writes to a table within the database. Although generally it is not necessary, SQLite can be instructed to give up attempting to write to a database after a certain time interval set by the sqlite_busy_timeout() function whose syntax is as follows:

sqlite_busy_timeout($db, $time);

$db is the database handle resource and $time is the time (in milliseconds) to wait for a database to become unlocked before returning a SQLITE_BUSY error. By default, SQLite will wait a maximum of 60 seconds (60,000 milliseconds) before returning an error. Setting the $time value to zero will instruct SQLite to wait indefinitely for the database to be unlocked.

Although mostly applicable to situations where your PHP scripts must be functional on a variety of systems, the SQLite extension provides two functions to assist you in determining whether the version SQLite installed is sufficient for your script's need. These two functions are sqlite_libversion(), which returns the version of the SQLite library being used, and sqlite_libencoding(), which returns the encoding of the underlying SQLite library (which can be either ISO-8859-1 or UTF-8). Neither of these two functions requires any parameters.

This entry was posted on . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a comment.
Users' Comments (0)

Comment an article
  Name
  E-mail
   Title
Available characters: 4000
 Notify me of follow-up comments
This image contains a scrambled text, it is using a combination of colors, font size, background, angle in order to disallow computer to automate reading. You will have to reproduce it to post on my homepage
Enter what you see:

No comment posted

Rokok Kretek Jumbo Coklat

“Terbuat dari tembakau, saos dan cengkeh pilihan kwalitas tinggi sehingga menghasilkan rokok dengan rasa yang cocok untuk segala cuaca”
Jumbo Coklat - Powered By G-Ads

 
Top! Top!