Forum Moderators: coopster
One of the moderators at the WP forum posted this obscure reply which only contains this code:
$results = $wpdb->get_results("select postnumber, cntaccess from mostAccessed ORDER BY cntaccess DESC LIMIT 1000"); Since he's not replying to any questions of mine, can anyone help me figure out what this code does, where it should be installed & how it would display the data within the blog interface? I also assume the "LIMIT 1000" should read "LIMIT 100?"
Thanks for any help you can provide.
You are correct, the LIMIT clause is a MySQL/Postgresql-specific keyword that returns only that number of rows after processing the query. WP is using some form of data abstraction class to run it's querys and return result sets. You would need to process the result set just as you do any other query within the WP appication(s).
even I don't know if this will help you or not....but this is the code that I use to find out if the user is human or bot(over 90% perfect)
$browser = $HTTP_USER_AGENT;
$terms = "bot";
if (eregi($terms, $browser)) {
// this visitor is bot don't update hits.
}else {
// this visitor is human update hits.
}
I don't know if you will be able to put it in your code.
Thanks
Bye