Jump to content

Prestashop DB error


toydoy

Recommended Posts

I have following error when try to create a product and save friendly url.

 

******************************************************************************

Unknown column 'id_employee' in 'field list'
INSERT INTO `ps_log` (`severity`, `error_code`, `message`, `object_id`, `id_employee`, `object_type`, `date_add`, `date_upd`) VALUES ('1', '0', 'Product addition', '42', '1', 'Product', '2014-02-10 12:06:07', '2014-02-10 12:06:07')

******************************************************************************

 

And following is Advanced parameters>>Logs

I am not sure what caused this.

I looked at ps_employee table and there is an id_employee column.

Is there any solution for this?

 

 

******************************************************************************

[PrestaShopDatabaseException]

Unknown column 'a.id_employee' in 'on clause'
 

        SELECT SQL_CALC_FOUND_ROWS
         a.*
        , CONCAT(LEFT(e.firstname, 1), '. ', e.lastname) employee
        FROM `ps_log` a
        
         LEFT JOIN ps_employee e ON (a.id_employee = e.id_employee)
        
        WHERE 1
        
        
        ORDER BY a.`id_log` ASC LIMIT 0,50

at line 613 in file classes/db/Db.php

 

607.             WebserviceRequest::getInstance()->setError(500, '
 '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
608.         }
609.         else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
610.         {
611.             if ($sql)
612.                 throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
613.             throw new PrestaShopDatabaseException($this->getMsgError());
614.         }
615.     }
616.
617.     /**
Link to comment
Share on other sites

vekia,

I have same problem (after update 1.5.6.0 -> 1.5.6.2)

I have got an access to database manager like phpmyadmin. Where and how exactly I add INT (10) NULL ?

Thank You

 

 

it's a definition of database field (datatype)

it's a integer.

 

you have to create this column in table,

 

have you got an access to database manager like phpmyadmin?

Link to comment
Share on other sites

  • 1 year later...

Hi. I have problem with prestashop 1.5.6.2
Database slow query.
 

# Time: 150511 11:10:46
# User@Host: db_new[db_new] @  [10.10.35.27]
# Thread_id: 15634670  Schema: db_new  QC_hit: No
# Query_time: 5.807437  Lock_time: 0.001998  Rows_sent: 50  Rows_examined: 2437
use db_new;
SET timestamp=1431335446;
SELECT SQL_CALC_FOUND_ROWS
a.`id_cart`,a.date_add as date_add
, CONCAT(LEFT(c.`firstname`, 1), '. ', c.`lastname`) `customer`, a.id_cart total, ca.name carrier, o.id_order, IF(co.id_guest, 1, 0) id_guest
FROM `ps_cart` a
 
LEFT JOIN ps_customer c ON (c.id_customer = a.id_customer)
LEFT JOIN ps_currency cu ON (cu.id_currency = a.id_currency)
LEFT JOIN ps_carrier ca ON (ca.id_carrier = a.id_carrier)
LEFT JOIN ps_orders o ON (o.id_cart = a.id_cart)
LEFT JOIN `ps_connections` co ON (a.id_guest = co.id_guest AND TIME_TO_SEC(TIMEDIFF(NOW(), co.`date_add`)) < 1800) 
 
WHERE 1 
 
 
ORDER BY a.`id_cart` DESC LIMIT 0,50;
# Time: 150511 13:54:11
# User@Host: db_new[db_new] @  [10.10.35.27]
# Thread_id: 15788576  Schema: db_new  QC_hit: No
# Query_time: 7.505560  Lock_time: 0.001084  Rows_sent: 50  Rows_examined: 2402
use db_new;
SET timestamp=1431345251;
SELECT SQL_CALC_FOUND_ROWS
a.`id_cart`,a.date_add as date_add
, CONCAT(LEFT(c.`firstname`, 1), '. ', c.`lastname`) `customer`, a.id_cart total, ca.name carrier, o.id_order, IF(co.id_guest, 1, 0) id_guest
FROM `ps_cart` a
 
LEFT JOIN ps_customer c ON (c.id_customer = a.id_customer)
LEFT JOIN ps_currency cu ON (cu.id_currency = a.id_currency)
LEFT JOIN ps_carrier ca ON (ca.id_carrier = a.id_carrier)
LEFT JOIN ps_orders o ON (o.id_cart = a.id_cart)
LEFT JOIN `ps_connections` co ON (a.id_guest = co.id_guest AND TIME_TO_SEC(TIMEDIFF(NOW(), co.`date_add`)) < 1800) 
 
WHERE 1 
 
 
ORDER BY a.`id_cart` DESC LIMIT 0,50;
 
 
 
 
Whats the problem? Please help me
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...