SQLite is an ultra lite database replacement that comes bundled with PHP. Because of its light weight it lacks many of the features found in more robust applications such as MySQL, PostgresQL and others. One of the features that is lacking is the ON DUPLICATE KEY UPDATE that is often used to automatically UPDATE a record, should a duplicate field be found. Here a demonstration is provided to duplicate this behaviour using PHP Exceptions.
At home I use an rather old (antique some may say) computer (PII@350, 256RAM) as a web server and for testing purposes. All went fine until one of the pages hosted was hit by the "digg effect" and about 15 users wanted to see that page every second. The main problem was that I used MySQL to store some access logs and generate some real-time statistics. Physical memory was limited and Apache and MySQL soon started to fight for every remaining byte and eventually the page was unavailable.
After this experience I started to look for a alternative for the database storage and I found an interesting one: SQLite. SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.
Are you one of those PHP developers looking for a tight and powerful RDBMS, other than MySQL, in order to build your next database-driven website? Then hopefully your search is finished. Welcome to the second installment of the series “Using SQLite with PHP 5.” Comprised of three articles, this series walks you through the implementation of the most important methods that come bundled with SQLite and shows you how to use them with numerous practical examples.
If you use PHP 5 to build web-based applications that access a database, you might want to consider SQLite. A "lighter" option than MySQL, this database may still suit your purposes if you don't need all of MySQL's bells and whistles. This three-part series covers many of SQLite's most useful features.
When most of us think of PHP, we think of developing for the web. In most cases we will be using a LAMP-based server setup, with our favorite web scripting language contributing the P. In most cases, the M is filled in with MySQL, although PHP does include support for several other database systems. Is a full-blown database server even necessary for most PHP applications? What about a data-driven website like a blog or a simple family photo album or message board? In these and may other cases, the small, simple, and extremely powerful SQLite may be all you need. Let's take SQLite out for a test drive and see how it performs, find some of the quirks you might run in to, and how to get the most use out of it.
PHP developers building applications for distribution usually spend part of their time worrying about the availability and configuration of a DBMS on the systems their app will live on.
In many cases, SQLite makes all of these worries go away - SQLite is a fast, transactional and zero-configuration DBMS that is embedded (by default) in PHP 5.
This session will cover:
* an overview of SQLite
* the basics of working with SQLite
* appropriate uses for the DBMS
* tips on efficient daily use of the DBMS
This is not going to be another rant about SQLite security, but a couple of things have put me back on the war path.
I was going over the most recent PHP Magazine when I noticed a snippet of code in which a SQLite database was being opened like: ...
As discouraged as using register_globals is, most people who write about PHP will never admit that using register_globals is in itself is a security risk. Sloppy coding, coupled with register_globals being turned on can create security problems. Because of this, register_globals was turned off by default. A wise decision.
SQLite could very easily fall into the same category as register_globals.
If you've been paying attention, you now know how to use PHP's MySQL API to perform queries and process result sets. You might even have started thinking about how to re-program your site to run off a MySQL database. All of this is a Good Thing - it means you're getting comfortable with using PHP's database support to power your applications - but there's still a little further to go.
For the last few months both developers and reviewers have been going crazy about the improvements and new features in PHP 5. One of these new features is a fast and efficient database extension called SQLite. In this article we will take a closer look at one of its lesser known features: in-memory databases. Speed. Everything has to be as fast as possible, because we don't like to wait. We don't like to wait in the supermarket and we don't like to wait in traffic. Speed is efficient. Speed is the sole reason that computer technology is where it is today. Technology can make business, science and ordinary life more productive and efficient. Productivity requires speed and software development is a constant struggle for more productivity and faster applications.








