worldofcarp
-
Posts
4 -
Joined
-
Last visited
Never
Posts posted by worldofcarp
-
-
This page has some ok documentation on dates in php: http://php-date.com/
-
The table isn't that big, so these queries shouldn't that expensive, so a little overhead but not that big a deal. Should put an index on the timestamp column.
But this is strange -- it counts users more than once if they change pages rapidly. Plus DISTINCT's may be expensive. Should use count(distinct ip) at least. Or just cut out the "file" column and use count(*) which is a million times faster.
-
That function takes seconds as an input.
I think the strtotime($now) where $now=time() might be the problem -- time() returns a timestamp as an integer, strtotime() takes a string representation of a time and automagically converts it into a timestamp. If you pass time() to strtotime() I'm not sure what it will do. Just use time() instead of strtotime(time()).
This page has some good documentation on what strtotime does
[SOLVED] validate include, include_once, require, etc..
in PHP Coding Help
Posted
Another option is to do something like
if (@include('whatever.file')) {
// was able to include file
} else {
// wasn't able to include file
}
the @ suppresses the error message if it isn't there, and it will return true or false if it was able to include the file or not.