Jump to content

Bad SQL query ?


Recommended Posts

Hi Everyone

 

We are on PrestaShop 1.5.....I was in the middle of adding new products and realized that I did not need the product so deleted it and its category.

 

I then clicked onto products and nothing came up except

  • Bad SQL query
    Unknown column 'cp.position' in 'field list'

 

Does anybody know what this is and how to get rid of it ?

 

This is a big problem as none of my products are showing, I would be greatly thankful if anyone can help me out.

Link to comment
Share on other sites

so can you check the ps_category_product tab, maybe you've got there entries related to the 429 category id. If so, this is causing the issue probably. (i've got similar problem some time ago)

 

you can run query:

SELECT * FROM ps_category_product where id_category=429

Link to comment
Share on other sites

Hi Vekia

 

The sub-category I deleted was under another 2 sub-categories which had 427 & 428 ID numbers so im guessing the one I deleted was 429 ?

 

There is a separate category that has the ID 429.......

 

I'm very sorry if I am causing you frustration as you are doing your best to help but I do not know what you mean when you say ps_category_product

 

The entire product page is not showing but just shows

  • Bad SQL query
    Unknown column 'cp.position' in 'field list'

Every other page and category sections in my back office works.

Link to comment
Share on other sites

I think the following query in phpmyadmin will give you the problematic ids. The ids returned by the query will indicate the rows that must be deleted in table ps_category_product.

 

You could try this select to see if hangs some category in ps_category_product table

 

SELECT  cp.id_category from ps_category_product cp WHERE cp.id_category NOT IN (SELECT  c.id_category from ps_category c)

Link to comment
Share on other sites

  • 5 months later...

Hi

Something has happened to our website and it has completely crashed lost all products the error we have is 

  • Bad SQL query
    Table './mayday/ps_product_lang' is marked as crashed and should be repaired
  •  
  • Not sure what has happened and our 'IT' department are being less than helpful.
  • can anyone shed any light on what has happened
  • Thanks
Link to comment
Share on other sites

  • 4 weeks later...

I'm having a similar issue when I was trying to delete a single product.  I'm also having issues with saving ANY new data in ANY of my products.....it just cycles forever, eventually times out and returns an error 404.  

 

Any ideas?

Link to comment
Share on other sites

I'm having a similar issue when I was trying to delete a single product.  I'm also having issues with saving ANY new data in ANY of my products.....it just cycles forever, eventually times out and returns an error 404.  

 

Any ideas?

We were having the same issues after a long fight with our IT dept. We are going to try going to a high performance server as we have enough room on the server but it isn't quick enough for all the information that we have.

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

@ Maydayseals - Are you getting a bad SQL error message AND the 404 error while trying to update products or just the bad SQL message?  

 

I'm building out my site and I have only 10 demo products (5 that came with my theme, 5 I created on my own), I cannot save any additional information on any of them.  I cannot even delete them.  

 

Do I understand that you are trying for a dedicated server?

 

My site is nearly finished, but if I cannot add, modify, delete products this site will be useless and years worth of work are going to go down the drain.

Link to comment
Share on other sites

I don't know an awful lot about it but we are with a company called Fast Hosts who held all our website on a standard server. we are just hoping that moving it to a high performance high speed server may help i think its costing an extra £12.00 or something but we have over 3,000 products though. So i am not sure with yours sorry.

Link to comment
Share on other sites

×
×
  • Create New...