jasonaudio Posted April 22, 2004 Posted April 22, 2004 As the title says, I want to add the registered customers & products in the database to the footer of my website. This is the info I want to add to the footer (which is originally from the admin index): Statistics Customers: 194 Products: 630 I have been messing with it a little bit and this is the code I have added to my footer, but I can't get the counters/numbers to show up correctly. <?php echo $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); $products = tep_db_fetch_array($products_query); $contents[] = array('params' => 'class="infoBox"', 'text' => $customers['count'] . '<br>' . $products['count']) ;?> Any help or ideas from anyone. I just want to show the # of registered customers & the # of products available. I appreciate your help ;)
241 Posted April 22, 2004 Posted April 22, 2004 here is a very crude method <?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 . ' ' . $customers['count'] . '<br>' . PRODUCTS . ' ' . $products['count'] . '<br>'; ?> No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes.
241 Posted April 22, 2004 Posted April 22, 2004 you may want to put some window dressing around the code and alter the <br> breaks to suit, depending on where you are placing the code also you may want to put some style to the text and or change the textual wording at present it is all uppercase with CUSTOMERS and PRODUCTS No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes.
agiftcodotcom Posted April 22, 2004 Posted April 22, 2004 novice php here, will you edit that so it will say X customers x products instead of customers x products x? Contributions I used : Updated 06-13-04 23:42 ---------------- Vote on My Graphis Poll
241 Posted April 22, 2004 Posted April 22, 2004 OK do you really want the x :lol: <?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>'; ?> No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes.
agiftcodotcom Posted April 23, 2004 Posted April 23, 2004 Well, I installed the code and everything worked, but the X's didn't show up :P Contributions I used : Updated 06-13-04 23:42 ---------------- Vote on My Graphis Poll
jasonaudio Posted April 23, 2004 Author Posted April 23, 2004 Thank you SOOO much! That's exactly what I was looking for. I knew I was close too, but I just couldn't get it exact Thanks again ;)
241 Posted April 23, 2004 Posted April 23, 2004 agiftcodotcom the x's are hidden :blink: glad I could help, however as I say you may want to put your own style etc on the text No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.