smeagol2009 Posted March 1, 2010 Share Posted March 1, 2010 Iam trying to log which administrator has updated an order. My problem is that I cannot get the admin id to save in 'Order_status_history' Can anyone please advise on any possible ways of getting the admin name to show other than using $admin['username'] On admin/orders.php I have the following which should write the admin user to the 'updated_by' table in 'order_status_history' tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments, updated_by) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "', '" . $admin['username'] . "')"); I do not have a username field in my admin table, instead I have Admin firstname, lastname, email_adress etc. I have tried adding the 'username' field and adding a name but it makes no difference. Also, I have tried $admin['firstname'] $admin['lastname'] $admin['email_address'] but none work. Any help appreciated. Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted March 1, 2010 Share Posted March 1, 2010 Have you tried this... $admin_name = tep_session_name('osCAdminID'); tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments, updated_by) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "', '" . $admin_name . "')"); Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.