Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

whois online -need help


Guest

Recommended Posts

I got this error a few times and it is shutting dowm my store:

1030 - Got error 127 from table handler

 

delete from whos_online where time_last_click < '1192376106'

 

[TEP STOP]

 

I went to application_top.php and commented out those lines

// include the who's online functions

// require(DIR_WS_FUNCTIONS . 'whos_online.php');

// tep_update_whos_online();

and then I commented out all whos_online.php:

whos_online.php

<?php

/*

$Id: whos_online.php,v 1.11 2003/06/20 00:12:59 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

 

 

function tep_update_whos_online() {

global $customer_id;

 

if (tep_session_is_registered('customer_id')) {

$wo_customer_id = $customer_id;

 

$customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");

$customer = tep_db_fetch_array($customer_query);

 

$wo_full_name = $customer['customers_firstname'] . ' ' . $customer['customers_lastname'];

} else {

$wo_customer_id = '';

$wo_full_name = 'Guest';

}

 

$wo_session_id = tep_session_id();

$wo_ip_address = getenv('REMOTE_ADDR');

$wo_last_page_url = getenv('REQUEST_URI');

 

$current_time = time();

$xx_mins_ago = ($current_time - 900);

 

// remove entries that have expired

tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");

 

$stored_customer_query = tep_db_query("select count(*) as count from " . TABLE_WHOS_ONLINE . " where session_id = '" . tep_db_input($wo_session_id) . "'");

$stored_customer = tep_db_fetch_array($stored_customer_query);

 

if ($stored_customer['count'] > 0) {

tep_db_query("update " . TABLE_WHOS_ONLINE . " set customer_id = '" . (int)$wo_customer_id . "', full_name = '" . tep_db_input($wo_full_name) . "', ip_address = '" . tep_db_input($wo_ip_address) . "', time_last_click = '" . tep_db_input($current_time) . "', last_page_url = '" . tep_db_input($wo_last_page_url) . "' where session_id = '" . tep_db_input($wo_session_id) . "'");

} else {

tep_db_query("insert into " . TABLE_WHOS_ONLINE . " (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url) values ('" . (int)$wo_customer_id . "', '" . tep_db_input($wo_full_name) . "', '" . tep_db_input($wo_session_id) . "', '" . tep_db_input($wo_ip_address) . "', '" . tep_db_input($current_time) . "', '" . tep_db_input($current_time) . "', '" . tep_db_input($wo_last_page_url) . "')");

}

}

*/

?>

Will that work and stop the whos online from shutting down my web site?

I am getting error dbase few times a day.

Need advise.Thanks

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...