php-general Digest 28 Jan 2011 12:56:02 -0000 Issue 7156

2011-01-28 Thread php-general-digest-help
php-general Digest 28 Jan 2011 12:56:02 - Issue 7156 Topics (messages 311063 through 311065): Re: Pear Problems 311063 by: Ethan Rosenberg 311065 by: Daniel Brown Re: Cross-platform IDE 311064 by: Ross McKay Administrivia: To subscribe to the digest, e-mail:

Re: [PHP] Pear Problems

2011-01-28 Thread Daniel Brown
On Fri, Jan 28, 2011 at 00:33, Ethan Rosenberg eth...@earthlink.net wrote: Please take a look at php.ini in the vicinity of line 510.  You will see the construct to which I refer.  Can you explain what is going on?  I do not think it is a problem with commenting out a line. Any ideas from

[PHP] public static or static public?

2011-01-28 Thread Colin Guthrie
OK, so it's a Friday hence a random debate What is preferred for class methods? class foo { static public function bar(){} public static function wibble(){} } ?? All methods are valid, but are some more valid than others? :p Checking ZF: [colin@jimmy Zend (working)]$ cgrep public

Re: [PHP] public static or static public?

2011-01-28 Thread Fernando
I personally like scope static fucntion. Coming from C# it just makes more sense to me. JF. On 28/01/2011 12:15, Colin Guthrie wrote: OK, so it's a Friday hence a random debate What is preferred for class methods? class foo { static public function bar(){} public static function

Re: [PHP] Counting Online users, but not using a Session Table in MySQL

2011-01-28 Thread Fernando
How did you created the table? Can you count the Id's only? Wouldn't this just count the entries in the index? On 28/01/2011 12:57, AmirBehzad Eslami wrote: Dear list, The common solution for counting online users is to store sessions in a Table. I've created a Table in MySQL to acheive the

Re: [PHP] Counting Online users, but not using a Session Table in MySQL

2011-01-28 Thread Jim Lucas
On 1/28/2011 9:57 AM, AmirBehzad Eslami wrote: Dear list, The common solution for counting online users is to store sessions in a Table. I've created a Table in MySQL to acheive the result, but it seems this solution is a little heavy for such a simple task. Is there a better

Re: [PHP] String Encodings - loose guidelines

2011-01-28 Thread Donovan Brooke
Marc Guay wrote: 1.) Saving strings to a database One thing I always forget to remember is to send tge SET NAMES utf8 command to MySQL after making a connection. This will save you 1000 headaches if you're working with non-latin characters. I can't count the number of times I've thrown

Re: [PHP] public static or static public?

2011-01-28 Thread Mujtaba Arshad
Having learned java before even knowing what php was (yeah I'm a noob in both) I prefer scope static function. On Fri, Jan 28, 2011 at 12:20 PM, Fernando ferna...@ggtours.ca wrote: I personally like scope static fucntion. Coming from C# it just makes more sense to me. JF. On 28/01/2011

Re: [PHP] public static or static public?

2011-01-28 Thread David Harkness
On Fri, Jan 28, 2011 at 10:35 AM, Mujtaba Arshad mujtab...@gmail.comwrote: Having learned java before even knowing what php was (yeah I'm a noob in both) I prefer scope static function. I learned Java first, too, and also prefer the scope first. I place a scope on every method, so I'd rather

Re: [PHP] Counting Online users, but not using a Session Table in MySQL

2011-01-28 Thread AmirBehzad Eslami
Jim, I'm already using the solution you mentioned. The problem is about the performance. One solution is to increase the performance by using Memcached. But counting online users always requires a __new__fresh__ COUNT(*) query, even under Memcahched. Since the COUNT(*) result is very dynamic and

Re: [PHP] Counting Online users, but not using a Session Table in MySQL

2011-01-28 Thread David Harkness
If you're using memcached already you could store the number in it and update it only when a user logs in/out. If no one is logging in/out, the number isn't changing. If your site is so popular that hundreds of users are logging in every second you might want to change the logic so that the

Re: [PHP] Counting Online users, but not using a Session Table in MySQL

2011-01-28 Thread Marc Guay
I'm looking for a faster way to count online users. COUNT(*) is time consuming under MySQL. If COUNTing is the heavy part, why not create a 'users_logged_in' field somewhere and increment it when someone logs in and decrement it when someone logs out? Then your query is just a straight

Re: [PHP] Counting Online users, but not using a Session Table in MySQL

2011-01-28 Thread David Harkness
On Fri, Jan 28, 2011 at 11:03 AM, Marc Guay marc.g...@gmail.com wrote: If COUNTing is the heavy part, why not create a 'users_logged_in' field somewhere and increment it when someone logs in and decrement it when someone logs out? Then your query is just a straight SELECT. If this is like

Re: [PHP] Counting Online users, but not using a Session Table in MySQL

2011-01-28 Thread Jim Lucas
On 1/28/2011 11:23 AM, David Harkness wrote: On Fri, Jan 28, 2011 at 11:03 AM, Marc Guay marc.g...@gmail.com wrote: If COUNTing is the heavy part, why not create a 'users_logged_in' field somewhere and increment it when someone logs in and decrement it when someone logs out? Then your query