Jump to content

Column 'id_product' in where clause is ambiguous


Recommended Posts

Hola tengo un problema que no se como resolver, despues de haber hecho testes de compra he borrado clientes y pedidos com el limpiador de prestashop, despues de eso no consigo hacer pedidos que me aparece lo que pongo abajo

 

alguien p¡me puede ayudar?

gracias

 

[PrestaShopDatabaseException]

Column 'id_product' in where clause is ambiguous
 

                SELECT image_shop.id_image
                FROM ps_image i INNER JOIN ps_image_shop image_shop
        ON (image_shop.id_image = i.id_image AND image_shop.id_shop IN (1, 2) AND image_shop.cover=1)
                WHERE id_product = 1 LIMIT 1

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

 

641.             WebserviceRequest::getInstance()->setError(500, '
 '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
642.         }
643.         elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
644.         {
645.             if ($sql)
646.                 throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
647.             throw new PrestaShopDatabaseException($this->getMsgError());
648.         }
649.     }
650.
651.     /**

 

 

Link to comment
Share on other sites

  • 1 month later...

Hi i also face the same issue here. Is there is a bug or is due to other things? Any suggestion solution to this issue ?
 

[PrestaShopDatabaseException]
Column 'id_product' in where clause is ambiguous
 
                SELECT image_shop.id_image
                FROM ps_image i INNER JOIN ps_image_shop image_shop
        ON (image_shop.id_image = i.id_image AND image_shop.id_shop = 1 AND image_shop.cover=1)
                WHERE id_product = 141 LIMIT 1

at line 646 in file classes/db/Db.php
 
 
 
 
641.             WebserviceRequest::getInstance()->setError(500, '

 '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
642.         }
643.         elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
644.         {
645.             if ($sql)
646.                 throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
647.             throw new PrestaShopDatabaseException($this->getMsgError());
Link to comment
Share on other sites

A lo mejor me equivoco, pero creo que esa consulta es incorrecta.

 

El tema está en que la tabla ps_image_shop y ps_image Tienen el campo id_product y en la consulta no especifica a que tabla se refiere ese id_product, por eso es ambiguo.

 

Debería de ser WHERE image_shop.id_product = x

 

¿Qué version de PS tienes?

Link to comment
Share on other sites

  • 1 year later...

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...