Raullara Posted May 19, 2014 Share Posted May 19, 2014 (edited) Hi Everyone, Im trying to do an update on ps_stock_available table, i'm doing it this way. The first i do is read the xml file where i have the data i need foreach ($xml->children() as $products) { foreach ($products->children() as $product => $data) { $id_product = $data->id_product; $id_product_attribute = $data->id_product_subcategory; $stock = $data->stock; // STOCK DISPLAYS CORRECTLY $output .= $this->displayConfirmation($this->l($stock)); // DATA DISPLAYS CORRECTLY // $output .= $this->displayConfirmation($this->l($id_product)); // $output .= $this->displayConfirmation($this->l($id_product_attribute)); // $output .= $this->displayConfirmation($this->l($stock)); // IS THE UPDATE EXECUTED CORRECTLY? my module do not crash Db::getInstance()->update('ps_stock_available', array( 'quantity' => (int)$stock, ). 'WHERE id_product = ' . $id_product . 'AND id_product_attribute = ' . $id_product_attribute); } } Thanks a lot in advance Edited May 19, 2014 by vekia (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 19, 2014 Share Posted May 19, 2014 and what you see in query outpur error message? Link to comment Share on other sites More sharing options...
Raullara Posted May 19, 2014 Author Share Posted May 19, 2014 and what you see in query outpur error message? Okay, with the help of this console ( i wasn't using it , sorry about that, im pretty new on developing on prestashop) its okay The problem was just the query, the name of the table was ps_ps_name, were 2 WHERE clauses etc. now works fine. Link to comment Share on other sites More sharing options...
vekia Posted May 19, 2014 Share Posted May 19, 2014 thank you for clarification i marked topic as solved and your answer as a solution Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now