Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"how many users online" with PHP: session or DB?

3 views
Skip to first unread message

Phil Powell

unread,
Nov 3, 2003, 10:39:02 PM11/3/03
to
http://codewalkers.com/seecode/75.html
http://www.webkreator.com/php/concepts/counting-users-online-with-php.html

The following two URLs illustrate different approaches to the idea of
showing "how many
users online" issue. I am looking at two different sites where I am looking
into implementing
this type of script; one that has mySQL and one that has no db access of any
kind; both use
PHP 4.1.

I (for once) understand what I would need to do to implement it; problem
comes in as to which
solution would be the fastest, most efficient and most secure considering
that one of them
deals with sessions (then there is the cookie issue, but that's another
issue altogether,
see http://www.webkreator.com/php/configuration/php-session-security.html on
security issues
and cookies/sessions).

What would one best recommend I use: the PHP/mySQL solution (for the non-db
issue I would have
to write complicated XML procedures instead), or sessions?

Oh, more info:

Site #1 (has mySQL) is Linux/Apache ??/mySQL 3.23.41 and PHP 4.1
Site #2 (has no DB) is generic UNIX/Apache ?? and PHP 4.1

Thanx
Phil


R. Rajesh Jeba Anbiah

unread,
Nov 4, 2003, 4:01:13 AM11/4/03
to
"Phil Powell" <soa...@erols.com> wrote in message news:<ldFpb.328$oB3.161@lakeread03>...
> http://codewalkers.com/seecode/75.html

This is just a guess work.

> http://www.webkreator.com/php/concepts/counting-users-online-with-php.html

Good. But, won't work if session gc probability is less.

Better method is to go for own session handler that use DB. And
counting the records in the session table.

---
"Success = 10% sweat + 90% tears"
Email: rrjanbiah-at-Y!com

Adam i Agnieszka Gasiorowski FNORD

unread,
Nov 10, 2003, 2:07:28 PM11/10/03
to
Phil Powell wrote:

> What would one best recommend I use: the PHP/mySQL solution (for the non-db
> issue I would have
> to write complicated XML procedures instead), or sessions?

How about a shared memory approach,
instead of database. This would be the
fastest, I think - no access to HDD (unless
swapping is involved).

--
Seks, seksić, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info { iWanToDie } WiNoNa ) (
http://szatanowskie-ladacznice.0-700.pl foReVeR( * )
Poznaj jej zwiewne kształty... http://www.opera.com 007

0 new messages