Jump to content

Mauvaise requête SQL Unknown column 'image_shop.id_product' in 'on clause'


Recommended Posts

Thanks a lot arnaud19951. That helped a lot.  I was able to get rid of the errors using the method described in the template monster tutorial.  Not sure if I did everything correctly but I guess I'll find out later....

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

I had this problem when I installed a template from Template Monster as well.  I don't know if it is a proper fix but if you follow the instructions from post #7, the problem doesn't show up anymore.

http://www.templatemonster.com/help/prestashop-1-6-x-how-to-fix-an-error-occurred-while-updating-an-object-product.html?

 

You need to create table entries for the missing columns.  Note that I ran into another 3-4 similar problems after "image_shop.id_product" was fixed.

 

My recommendation is to go with another template from somewhere else.  I ran into a ton of problems with Template Monster templates.  I am using a template from themeforest.net and those are much better.  They are much easier to configure and customize.  Here is a blog that I read which convinced me to try themeforest.

 

https://dh42.com/blog/template-monster-themes-suck/

 

If you really want to use the template from Template Monster, I would suggest using the exact same version of Prestashop that is listed in the details page of your template.  That way you can avoid these SQL query problems.

Link to comment
Share on other sites

I had this problem when I installed a template from Template Monster as well.  I don't know if it is a proper fix but if you follow the instructions from post #7, the problem doesn't show up anymore.

http://www.templatemonster.com/help/prestashop-1-6-x-how-to-fix-an-error-occurred-while-updating-an-object-product.html?

 

You need to create table entries for the missing columns.  Note that I ran into another 3-4 similar problems after "image_shop.id_product" was fixed.

 

My recommendation is to go with another template from somewhere else.  I ran into a ton of problems with Template Monster templates.  I am using a template from themeforest.net and those are much better.  They are much easier to configure and customize.  Here is a blog that I read which convinced me to try themeforest.

 

https://dh42.com/blog/template-monster-themes-suck/

 

If you really want to use the template from Template Monster, I would suggest using the exact same version of Prestashop that is listed in the details page of your template.  That way you can avoid these SQL query problems.

 

Mmmmm no, the solution on post #7 doesn't work for me. Can't find tables... 

 

I had to contact the support team and ask what's the problem... 

Obviously SQL. The answer was that the theme was supposed to be installed in the version 1.6.0.9, and ONLY later you can update to the lastest version 1.6.1.0

 

Yesterday I've installed the version 1.6.1.0 in a new website and after the template, so I've got the problem.

The interesting part is that on addons.prestashop the theme compatibility was from 1.6.0.4 to 1.6.1.0... I think this is not a good way to promote templates...

Link to comment
Share on other sites

Yeah.  I got the same response when I asked support team.  It worked better when using the theme with 1.6.0.9.  However, I still had other problems with the customization of the theme.  I would recommend that you take a look at the themes at themeforest.net.  Template Monster has nice looking themes but they were a pain for me to work with.

Link to comment
Share on other sites

Just execute this SQL

 

ALTER TABLE ps_image_shop ADD `id_product` int(10) unsigned NOT NULL, ADD KEY `id_product` (`id_product`, `id_shop`, `cover`);

 

it works fine for me! many thanks marczoo!

 

16-8-2015 update: out of the box the marczoo workaround seems to work but it's possible that, modifiying the table you can introduce instability

and entropy, as example now when i try to add an image to a product i get an error, if i look directly on phpMyAdmin i saw the backtrace:

 

Notice in ./libraries/tbl_columns_definition_form.inc.php#55

dot.gif Undefined variable: server

 

Backtrace

 

./libraries/structure.lib.php#2453: include(./libraries/tbl_columns_definition_form.inc.php)

./tbl_structure.php#45: PMA_displayHtmlForColumnChange(

string 'AEGUADE5TERE',

string 'ps_image_shop',

NULL,

string 'tbl_structure.php',

)

Edited by Jiabin (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Hello,

Iam getting this issue:Bad SQL Query

Unknown column ' image_shop.id_product ' in ' on clause ' But when i enabled error report, i got the information below.

760. 			WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
761. 		}
762. 		elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
763. 		{
764. 			if ($sql)
765. 				throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
766. 
767. 			throw new PrestaShopDatabaseException($this->getMsgError());
768. 		}
769. 	}
770. 

What could be the problem? You help will be highly appreciated

 

Thank you

Ronnie

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

Just execute this SQL

 

ALTER TABLE ps_image_shop ADD `id_product` int(10) unsigned NOT NULL, ADD KEY `id_product` (`id_product`, `id_shop`, `cover`);

 

I had the same problem when trying to upload a database backup from 1.6 to a test site on 1.6.1.3.  This solved the issue.  Thank you! :D

Link to comment
Share on other sites

  • 9 months later...

Hi I get the same error, so i am not able to add products

 

Error: Unknown column 'image_shop.id_product' in 'on clause'

 

I have tried al the things that are mentioned here. When I add a SQL I get the error that I need to sellect a database, but I only have one database.

I have prestashop 1.6.1.6

 

Can somebody help me? Thanks

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