Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6804045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:25:06+00:00 2026-05-26T19:25:06+00:00

I have a custom import and update products script for Magento. The script worked

  • 0

I have a custom import and update products script for Magento.
The script worked fine for a long time, I changed some stuff in the script but a command I did not change stopped working

This is the code that stopped working:

require_once("connArray.php");
$dbConfig = GetConn();
$db = Zend_Db::factory('Pdo_Mysql', $dbConfig);
$update = "UPDATE catalog_product_entity_decimal p_dec
       SET  p_dec.value = $dec_value
       WHERE  p_dec.entity_id = $entity_id AND p_dec.attribute_id = 64";
echo $update;
echo "<br>";
$result = $db->query($update);
var_dump($result);
echo "<br>";

The output is:

UPDATE catalog_product_entity_decimal p_dec SET p_dec.value = 30.8 WHERE p_dec.entity_id = 2 AND p_dec.attribute_id = 64
object(Zend_Db_Statement_Pdo)#451 (9) { ["_fetchMode:protected"]=> int(2) ["_stmt:protected"]=> object(PDOStatement)#440 (1) { ["queryString"]=> string(124) "UPDATE catalog_product_entity_decimal p_dec SET p_dec.value = 30.8 WHERE p_dec.entity_id = 2 AND p_dec.attribute_id = 64" } ["_adapter:protected"]=> object(Zend_Db_Adapter_Pdo_Mysql)#33 (12) { ["_pdoType:protected"]=> string(5) "mysql" ["_numericDataTypes:protected"]=> array(16) { [0]=> int(0) [1]=> int(1) [2]=> int(2) ["INT"]=> int(0) ["INTEGER"]=> int(0) ["MEDIUMINT"]=> int(0) ["SMALLINT"]=> int(0) ["TINYINT"]=> int(0) ["BIGINT"]=> int(1) ["SERIAL"]=> int(1) ["DEC"]=> int(2) ["DECIMAL"]=> int(2) ["DOUBLE"]=> int(2) ["DOUBLE PRECISION"]=> int(2) ["FIXED"]=> int(2) ["FLOAT"]=> int(2) } ["_defaultStmtClass:protected"]=> string(21) "Zend_Db_Statement_Pdo" ["_config:protected"]=> array(8) { ["host"]=> string(9) "localhost" ["username"]=> string(16) "***" ["password"]=> string(9) "***" ["dbname"]=> string(17) "***" ["driver_options"]=> array(1) { [1002]=> string(14) "SET NAMES UTF8" } ["charset"]=> NULL ["persistent"]=> bool(false) ["options"]=> array(2) { ["caseFolding"]=> int(0) ["autoQuoteIdentifiers"]=> bool(true) } } ["_fetchMode:protected"]=> int(2) ["_profiler:protected"]=> object(Zend_Db_Profiler)#20 (4) { ["_queryProfiles:protected"]=> array(0) { } ["_enabled:protected"]=> bool(false) ["_filterElapsedSecs:protected"]=> NULL ["_filterTypes:protected"]=> NULL } ["_defaultProfilerClass:protected"]=> string(16) "Zend_Db_Profiler" ["_connection:protected"]=> object(PDO)#32 (0) { } ["_caseFolding:protected"]=> int(0) ["_autoQuoteIdentifiers:protected"]=> bool(true) ["_allowSerialization:protected"]=> bool(true) ["_autoReconnectOnUnserialize:protected"]=> bool(false) } ["_attribute:protected"]=> array(0) { } ["_bindColumn:protected"]=> array(0) { } ["_bindParam:protected"]=> array(0) { } ["_sqlSplit:protected"]=> array(1) { [0]=> string(124) "UPDATE catalog_product_entity_decimal p_dec SET p_dec.value = 30.8 WHERE p_dec.entity_id = 2 AND p_dec.attribute_id = 64" } ["_sqlParam:protected"]=> array(1) { [0]=> string(124) "UPDATE catalog_product_entity_decimal p_dec SET p_dec.value = 30.8 WHERE p_dec.entity_id = 2 AND p_dec.attribute_id = 64" } ["_queryId:protected"]=> NULL } 

After the script runs, I check the DB and the relevant row didn’t change.
I’ve copied the outputed query to phpMyAdmin and it works fine there.

A select command that I run just before the above code runs fine and I have another update command in the script that does work, so it doesn’t look like a connection problem.

Thanks in advance.

///////////////////////////////////// UPDATE //////////////////////////////////////////////

I’ve tried to change the code to :

$data = array(
        'value'      => $dec_value
    );

    $where[] = "entity_id = " . $entity_id;
    $where[] = "attribute_id = 64";

    $result = $db->update('catalog_product_entity_decimal', $data, $where);
    var_dump($result);
    echo "<br>";

but it still doesn’t work.
$result output is int(1).

I’ve tried to add $db->beginTransaction() and $db->commit() (even though that by default, all Zend_Db Adapter classes operate in auto-commit mode) but I get an error :
“SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:25:07+00:00Added an answer on May 26, 2026 at 7:25 pm

    I fixed the problem. It was a bug in my code (I loaded the product object before the price change and I saved it after the price change so the object had the old price…)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have custom errors configured in my web.config, but IIS 6.0 is returning the
I'm looking into some XSS prevention in my Java application. I currently have custom
If I have a custom class called Tires: #import <Foundation/Foundation.h> @interface Tires : NSObject
I have a custom model fields, that can have 'chain' argument. from django.db import
I have created a custom even class which is pretty basic. But when calling
I have a mapview where i update my currentlocation with CoreLocation, but I also
I have a custom import tool which bulk-insert the data in temp (421776 rows).
I have a custom UserType which stores a date/time value in a TIMESTAMP field
I have a custom package and I am having import problems. The module structure
I have custom coded several enterprise applications for mid to large organizations to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.