NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP sessions and displaying who's online

Adam Maccabee Trachtenberg adam at trachtenberg.com
Tue Feb 3 14:45:27 EST 2004


On Tue, 3 Feb 2004 yury at heavenspa.com wrote:

> Folks.. is there a simple effective way to do this *without* using mySQL?
>
> if there is a tutorial/link, i'd appreciate it..
>
> example: there are 25 visitors online and 3,000,000 visitors since
> yesterday.

I'm making the assumption here that you don't want to use any database
and that you're just not philosophically opposed to MySQL. If that's
the case, consider SQLite.

It's a database library that uses flat files instead of a separate
application, so there's less administrative hassle. SQLite is bundled
with PHP 5 and available under 4.x from PECL. (http://pecl.php.net)

There's also a bundled session handler that works with PHP's session
code. To enable it, set session.save_handler to sqlite in your php.ini
file.

Note: Using SQLite is slower than just using files; however, if you're
not a high traffic web site, this should not be a problem. (Which I'm
guessing you are, since you don't want to use MySQL.)

-adam

-- 
adam at trachtenberg.com
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!



More information about the talk mailing list