Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Page Hits On Admin Page


gaspower

Recommended Posts

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

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

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

  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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...