Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: Help on a counter script!


Message #1 by Empier4552@a... on Sun, 26 Aug 2001 18:26:48 EDT
In a message dated 8/27/2001 3:30:37 PM Eastern Daylight Time, 
yomama@u... writes:


> This is just nit picking now, but the use of $increment here is strange to
> me.
> 
> Seems just overkill...  it doesn't look like you're using either $hits or
> $increment at all after the update, why create an extra variable for it?
> 
> Why not just $hits++; and use $hits in the query instead of $increment?
> 
> Even if you still used $increment = 1; you should use $hits += $increment;
> because it's the HITS that changes, not the increment.
> 
> Plus, that would mean that your variables would match better in your sql
> update as well.  Just a matter of style and (though negligible here)
> efficiency.
> 
> Nik

Yes, this was infact one of the things changed I just did the Hit++ type 
command to update it and shorten the code. :-)



  Return to Index