[UPHPU] get count of database records matching criteria

Steve Dibb steve at wonkabar.org
Mon Feb 28 08:18:34 MST 2005


> While we're at it, has anyone had luck with SQLite? I'd be curious to know
> if it holds up as well as MySQL under heavy load. Feel free to start a new
> thread to respond.

I've had a lot of luck with SQLite, and I love it.  Im going to use it 
as a drop-in replacement for my personal mysql backends, as soon as I 
get around to porting them.

However, don't jump into it unless you know the pros and the cons.

Some of the obvious pros:
- very fast
- small databases
- transactional support
- no daemon
- typeless data fields
- ANSI SQL compliant

Some cons to think about
- no ALTER TABLE (though they are developing that)
- no user restrictions
- some of the SQL commands are different from MySQL
- not many guis (if youre used to CLI, youll have no issues)

I'd at least give it a try and see if it fits your needs.  If MySQL is 
too much for you sometimes for some tasks, then sqlite is a great 
replacement.  Just make sure you design your databases well, cuz it's 
not fun to change the tables once you've created them.

Also, if youve postgres at all, you'll find that SQLite is very similar. 
  The commands are input syntax are almost identical that I've seen so 
far.  In fact, I've had a lot of success dumping tables to each other 
with minimal modification to the SQL files.  With MySQL you're not going 
to be as lucky if you're converting your tables, but it can be done.

If you're using PHP5 then the SQLite libraries are included by default. 
  If you're using PHP4 then just install PEAR and the SQLite PECL 
extension.  I would use sqlite3 over sqlite2 as well.  Its still in 
active development, but faster than v2, and the databases are smaller too.

Steve



More information about the UPHPU mailing list