Jump to content

Mysql Update Issues


rseigel

Recommended Posts

Hello,

 

I'm working with the 1.5.1 version of PrestShop in case anyone is familiar with it. I've included my original message in the Presta forums below.

 

So, it seems that the quantity field is no longer used in the product table and is instead pulled from the stock_available table. Thanks for the hour of total confusion Presta developers. :angry::D

 

I'm trying to update the quantities using a script outside of Presta (dropshipping - I pull the stock availability from them daily). It was working fine until the quantity field moved.

 

Here's the SQL I'm trying to run:

 

UPDATE stock_available
SET stock_available.quantity = 1
FROM stock_available
INNER JOIN product
ON stock_available.id_product = product.id_product
WHERE product.supplier_reference = 'BKFLAGPL';

 

The real script uses variables for stock_available.quantity and product.supplier_reference. I'm just trying to get the basic SQL to work.

 

I get the following error:

 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM stock_available INNER JOIN product ON stock_available.id_product = product.' at line 3

 

 

Any ideas on where I'm going wrong?

 

Any and all help would be much appreciated.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.