Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

What do I do?


monkeyman

Recommended Posts

How do I alter this counter.php file to set the startdate and the counter? (The main page of the site I am building says in the footer that the "table osCommerce.counter" does not exist because the startdate and counter are not set in"counter"):

 

<?php

/*

$Id: counter.php,v 1.5 2003/02/10 22:30:52 hpdl Exp $

 

osCommerce, Open Source E-Commerce

 

Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU

 

General Public License

*/

 

$counter_query = tep_db_query("select startdate, counter from " .

 

TABLE_COUNTER);

 

if (!tep_db_num_rows($counter_query)) {

$date_now = date('Ymd');

 

 

tep_db_query("insert into " . TABLE_COUNTER . " (startdate, counter) values ('" . $date_now . "',

 

'1')");

$counter_startdate = $date_now;

$counter_now = 1;

} else {

$counter =

 

tep_db_fetch_array($counter_query);

$counter_startdate = $counter['startdate'];

$counter_now =

 

($counter['counter'] + 1);

tep_db_query("update " . TABLE_COUNTER . " set counter = '" .

 

$counter_now . "'");

}

 

$counter_startdate_formatted = strftime(DATE_FORMAT_LONG, mktime(0, 0, 0,

 

substr($counter_startdate, 4, 2), substr($counter_startdate, -2), substr($counter_startdate, 0,

 

4)));

?>

Link to comment
Share on other sites

How many times are you going to keep posting this question?

 

I have already told you that you need to run the following script in phpMyAdmin:

 

CREATE TABLE counter (

startdate char(8),

counter int(12)

);

 

 

Do you actually have phpMyAdmin on your host? All you need to do is open it, click your database name on the left, then click the "SQL" tab, copy the above code into the box, then click "go"

Link to comment
Share on other sites

How many times are you going to keep posting this question?

 

I have already told you that you need to run the following script in phpMyAdmin:

 

CREATE TABLE counter (

startdate char(8),

counter int(12)

);

Do you actually have phpMyAdmin on your host? All you need to do is open it, click your database name on the left, then click the "SQL" tab, copy the above code into the box, then click "go"

 

 

THANK YOU THANK YOU THANK YOU!!!!!!! It worked!! I just didn't know the procedure for running sql. Thanks for your patience with Commander Newbie, here! :blush:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...