Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1016 - Can't open file: 'whos_online.MYI' (errno: 145)


precious

Recommended Posts

Hello,

I receive from this morning this error on several pages of my web site.

Please help.

Thanks,

Alex.

 

1016 - Can't open file: 'whos_online.MYI' (errno: 145)

 

delete from whos_online where time_last_click < '1140182182'

 

[TEP STOP]

Link to comment
Share on other sites

In PHPMyAdmin, run this in the SQL tab:

 

REPAIR TABLE whos_online

 

Thanks but I'm really a beginner in that:

I'm posting here the page I found but I'm not sure how and what modify.

Thanks again for your help.

 

Alex.

 

My page:

 

 

<?php

/*

$Id: whos_online.php,v 1.25 2002/05/20 11:42:00 dgw_ Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

 

$xx_mins_ago = (time() - 900);

 

require('includes/application_top.php');

 

require(DIR_WS_CLASSES . 'currencies.php');

$currencies = new currencies();

 

// remove entries that have expired

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

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="2" cellpadding="2">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ONLINE; ?></td>

<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_CUSTOMER_ID; ?></td>

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_FULL_NAME; ?></td>

<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_IP_ADDRESS; ?></td>

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ENTRY_TIME; ?></td>

<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_LAST_CLICK; ?></td>

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LAST_PAGE_URL; ?> </td>

</tr>

<?php

$whos_online_query = tep_db_query("select customer_id, full_name, ip_address, time_entry, time_last_click, last_page_url, session_id from " . TABLE_WHOS_ONLINE);

while ($whos_online = tep_db_fetch_array($whos_online_query)) {

$time_online = (time() - $whos_online['time_entry']);

if ( ((!$HTTP_GET_VARS['info']) || (@$HTTP_GET_VARS['info'] == $whos_online['session_id'])) && (!$info) ) {

$info = $whos_online['session_id'];

}

if ($whos_online['session_id'] == $info) {

echo ' <tr class="dataTableRowSelected">' . "\n";

} else {

echo ' <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_WHOS_ONLINE, tep_get_all_get_params(array('info', 'action')) . 'info=' . $whos_online['session_id'], 'NONSSL') . '\'">' . "\n";

}

?>

<td class="dataTableContent"><?php echo gmdate('H:i:s', $time_online); ?></td>

<td class="dataTableContent" align="center"><?php echo $whos_online['customer_id']; ?></td>

<td class="dataTableContent"><?php echo $whos_online['full_name']; ?></td>

<td class="dataTableContent" align="center"><?php echo $whos_online['ip_address']; ?></td>

<td class="dataTableContent"><?php echo date('H:i:s', $whos_online['time_entry']); ?></td>

<td class="dataTableContent" align="center"><?php echo date('H:i:s', $whos_online['time_last_click']); ?></td>

<td class="dataTableContent"><?php if (eregi('^(.*)' . tep_session_name() . '=[a-f,0-9]+[&]*(.*)', $whos_online['last_page_url'], $array)) { echo $array[1] . $array[2]; } else { echo $whos_online['last_page_url']; } ?> </td>

</tr>

<?php

}

?>

<tr>

<td class="smallText" colspan="7"><?php echo sprintf(TEXT_NUMBER_OF_CUSTOMERS, tep_db_num_rows($whos_online_query)); ?></td>

</tr>

</table></td>

<?php

$heading = array();

$contents = array();

if ($info) {

$heading[] = array('text' => '<b>' . TABLE_HEADING_SHOPPING_CART . '</b>');

 

$session_data = tep_db_query("select value from " . TABLE_SESSIONS . " WHERE sesskey = '" . $info . "'");

if (tep_db_num_rows($session_data)) {

$session_data = tep_db_fetch_array($session_data);

$session_data = trim($session_data['value']);

} else {

$session_data = @file(tep_session_save_path() . '/sess_' . $info);

$session_data = trim($session_data[0]);

}

session_decode($session_data);

 

if (is_object($cart)) {

$products = $cart->get_products();

for ($i=0; $i<sizeof($products); $i++) {

$contents[] = array('text' => $products[$i]['quantity'] . ' x ' . $products[$i]['name']);

}

 

if (sizeof($products) > 0) {

$contents[] = array('text' => tep_draw_separator('pixel_black.gif', '100%', '1'));

$contents[] = array('align' => 'right', 'text' => TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($cart->show_total(), true, $currency));

} else {

$contents[] = array('text' => ' ');

}

}

}

 

if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {

echo ' <td width="25%" valign="top">' . "\n";

 

$box = new box;

echo $box->infoBox($heading, $contents);

 

echo ' </td>' . "\n";

}

?>

</tr>

</table></td>

</tr>

</table></td>

<!-- body_text_eof //-->

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

Thanks but I'm really a beginner in that:

I'm posting here the page I found but I'm not sure how and what modify.

Thanks again for your help.

 

Alex.

Nothing in that script has anything to do with the problem. The database table needs repair. It's not hard to do it with phpMyAdmin, the later versions have a button just for the purpose.

 

Select the table in the left hand column: whos_online, a new window opens.

 

Then look at the tabs on the top, you want: Operations, then -> Table Maintenance -> Repair Table

Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux

Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)

Link to comment
Share on other sites

Nothing in that script has anything to do with the problem. The database table needs repair. It's not hard to do it with phpMyAdmin, the later versions have a button just for the purpose.

 

Select the table in the left hand column: whos_online, a new window opens.

 

Then look at the tabs on the top, you want: Operations, then -> Table Maintenance -> Repair Table

 

 

Hi,

when I try to open from admin/tools the whos-online page I receive this message:

1016 - Can't open file: 'whos_online.MYI' (errno: 145)

 

delete from whos_online where time_last_click < '1140199753'

 

[TEP STOP]

 

And I'm stopped there....

Link to comment
Share on other sites

Hi,

when I try to open from admin/tools the whos-online page I receive this message:

1016 - Can't open file: 'whos_online.MYI' (errno: 145)

 

delete from whos_online where time_last_click < '1140199753'

 

[TEP STOP]

 

And I'm stopped there....

Alex,

 

AlanR is talking about phpMyAdmin, a web based administration tool for your MySQL database. Not the osCommerce admin.

 

ed

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...