gaspower Posted January 24, 2009 Share Posted January 24, 2009 Hello, I am using the below code on my admin page for customer count and product count, but I want to add site page hits from counter. For some reason everything I try breaks the page. Any help on how to add to my code would be greatly appreciated. Just need to add counter hits, <?php $customers_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS); $customers = tep_db_fetch_array($customers_query); $products_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS . " where products_status = '1'"); $products = tep_db_fetch_array($products_query); echo $customers['count'] . ' ' . CUSTOMERS . '<br>' . $products['count'] . ' ' . PRODUCTS . '<br>'; ?> Thanks JR Link to comment Share on other sites More sharing options...
♥geoffreywalton Posted January 24, 2009 Share Posted January 24, 2009 and what is the error you get? Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>. Link to comment Share on other sites More sharing options...
gaspower Posted January 24, 2009 Author Share Posted January 24, 2009 Hello, When I add this, $counter_query = tep_db_query("select counter from " . TABLE_COUNTER); I get this error, 1146 - Table 'website.TABLE_COUNTER' doesn't exist select counter from TABLE_COUNTER But Table_counter does exits in the database? Thank you JR Link to comment Share on other sites More sharing options...
germ Posted January 24, 2009 Share Posted January 24, 2009 define('TABLE_COUNTER', 'counter'); Add to /admin/includes/database_tables.php If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
gaspower Posted January 24, 2009 Author Share Posted January 24, 2009 Hello Jim, Thank you, no error now. Thanks JR Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.