bluemoonbikes Posted October 16, 2007 Share Posted October 16, 2007 I want to thank everyone for the previos information given!! I have received a lot of help though I just cannot fix our site and I think in trying I probably made thing worse. I need some DETAILED HOW TO help with this error: 1054 - Unknown column 'http_referer' in 'field list' insert into whos_online (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url, http_referer) values ('0', 'Guest', '', '66.225.39.130', '1192549378', '1192549378', '', 'http://bluemoonbikes.com/mambo/component/option,com_wrapper/Itemid,35/') [TEP STOP] THIS IS THE CONTENT: <?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() { // WOL 1.6 - Need access to spider_flag and user_agent and moved some assignments up here from below global $customer_id, $spider_flag, $user_agent; //$wo_ip_address = getenv('remote_addr'); $wo_ip_address = tep_get_ip_address(); $wo_last_page_url = getenv('request_uri'); $current_time = time(); $xx_mins_ago = ($current_time - 900); $wo_session_id = tep_session_id(); // WOL 1.6 EOF 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']; // WOL 1.6 - Moved session_id assignment into if statement (was just below.) $wo_session_id = tep_session_id(); // WOL 1.6 EOF } else { // WOL 1.6 - Write Spiders name (User Agent) as full name and use IP Address as SessionID if ( $spider_flag ) { // Bots are customerID = -1 $wo_customer_id = -1; // Remove (URL) from spiders name //$wo_full_name = substr( $user_agent, 0, strcspn( $user_agent, '(' ) ); $wo_full_name = $user_agent; //$wo_session_id = $wo_ip_address; } else { // Just in case it wasn't a spider after all $wo_full_name = 'Guest'; $wo_customer_id = '0'; } // WOL 1.6 EOF } // 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, http_referer) 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) . "', '" . tep_db_input($_SERVER['HTTP_REFERER']) . "')"); } } ?> Link to comment Share on other sites More sharing options...
Nullachtfuffzehn Posted October 16, 2007 Share Posted October 16, 2007 As I already posted to one of your earlier htreads, just ad the field to the database table and you're good to go. I also posted the statement to run in phpMyAdmin to get rid of that error. Link to comment Share on other sites More sharing options...
bluemoonbikes Posted October 16, 2007 Author Share Posted October 16, 2007 As I already posted to one of your earlier htreads, just ad the field to the database table and you're good to go. I also posted the statement to run in phpMyAdmin to get rid of that error. Please excuse my ignorance, I am the website editor, not the database tech. I am not real famililar with this type of repair. I have been trying all of these repairs in many different ways and I cannot get it to work. I need more detailed how to info ??? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.