Direct sql query in magento not working Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Upgrade from 1.9.1 to 1.9.2 ErrorSite went down after last designer cleared cacheMYSQL ERROR [1045] Acces denied for user 'username'@'localhost' (using password: YES)Magento order data not getting using observer event from adminMagento cant make an orderThere has been an error processing your request magento 1.9.0.1SQLSTATE[HY000] : General error: 2013 Lost connection to MySQL server during query in MagentoMagento installation on live server is throwing errorSome transactions have not been committed or rolled backMagento 1.9 - There has been an error processing your request

Random body shuffle every night—can we still function?

Is there more forest in the Northern Hemisphere now than 100 years ago?

AppleTVs create a chatty alternate WiFi network

Is it dangerous to install hacking tools on my private linux machine?

What to do with repeated rejections for phd position

How many time has Arya actually used Needle?

How did Fremen produce and carry enough thumpers to use Sandworms as de facto Ubers?

Asymptotics question

Cut your dress down to your length/size

How does the math work when buying airline miles?

Connecting Mac Book Pro 2017 to 2 Projectors via USB C

What is the difference between CTSS and ITS?

What does Turing mean by this statement?

Drawing a ribbon graph

Google .dev domain strangely redirects to https

New Order #6: Easter Egg

What would you call this weird metallic apparatus that allows you to lift people?

Does the Mueller report show a conspiracy between Russia and the Trump Campaign?

How does light 'choose' between wave and particle behaviour?

How were pictures turned from film to a big picture in a picture frame before digital scanning?

Why are vacuum tubes still used in amateur radios?

How could we fake a moon landing now?

Why does electrolysis of aqueous concentrated sodium bromide produce bromine at the anode?

Why weren't discrete x86 CPUs ever used in game hardware?



Direct sql query in magento not working



Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Upgrade from 1.9.1 to 1.9.2 ErrorSite went down after last designer cleared cacheMYSQL ERROR [1045] Acces denied for user 'username'@'localhost' (using password: YES)Magento order data not getting using observer event from adminMagento cant make an orderThere has been an error processing your request magento 1.9.0.1SQLSTATE[HY000] : General error: 2013 Lost connection to MySQL server during query in MagentoMagento installation on live server is throwing errorSome transactions have not been committed or rolled backMagento 1.9 - There has been an error processing your request



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am facing strange problem, when I use direct SQL query method in Magento controller its not working



 $resource = Mage::getSingleton('core/resource');
$connection = $resource->getConnection('core_write');
$table = $resource->getTableName('toynav_referral');

$query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);


But when I use this in controller its working fine and one thing the fetch method works everywhere as expected.
When I debug in the system.log file i got the below error




User Error: Some transactions have not been committed or rolled back in /var/www/vhosts/************/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 3937




Please advise me










share|improve this question
















bumped to the homepage by Community 15 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • where do you want to use this? in a save operation maybe? if you use this while a mysql-transaction is happening, this may be a problem

    – simonthesorcerer
    Sep 22 '17 at 21:11

















0















I am facing strange problem, when I use direct SQL query method in Magento controller its not working



 $resource = Mage::getSingleton('core/resource');
$connection = $resource->getConnection('core_write');
$table = $resource->getTableName('toynav_referral');

$query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);


But when I use this in controller its working fine and one thing the fetch method works everywhere as expected.
When I debug in the system.log file i got the below error




User Error: Some transactions have not been committed or rolled back in /var/www/vhosts/************/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 3937




Please advise me










share|improve this question
















bumped to the homepage by Community 15 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • where do you want to use this? in a save operation maybe? if you use this while a mysql-transaction is happening, this may be a problem

    – simonthesorcerer
    Sep 22 '17 at 21:11













0












0








0








I am facing strange problem, when I use direct SQL query method in Magento controller its not working



 $resource = Mage::getSingleton('core/resource');
$connection = $resource->getConnection('core_write');
$table = $resource->getTableName('toynav_referral');

$query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);


But when I use this in controller its working fine and one thing the fetch method works everywhere as expected.
When I debug in the system.log file i got the below error




User Error: Some transactions have not been committed or rolled back in /var/www/vhosts/************/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 3937




Please advise me










share|improve this question
















I am facing strange problem, when I use direct SQL query method in Magento controller its not working



 $resource = Mage::getSingleton('core/resource');
$connection = $resource->getConnection('core_write');
$table = $resource->getTableName('toynav_referral');

$query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);


But when I use this in controller its working fine and one thing the fetch method works everywhere as expected.
When I debug in the system.log file i got the below error




User Error: Some transactions have not been committed or rolled back in /var/www/vhosts/************/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 3937




Please advise me







magento-1.9 database






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 4 '16 at 17:46







Rinto George

















asked Jul 4 '16 at 8:37









Rinto GeorgeRinto George

195213




195213





bumped to the homepage by Community 15 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 15 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • where do you want to use this? in a save operation maybe? if you use this while a mysql-transaction is happening, this may be a problem

    – simonthesorcerer
    Sep 22 '17 at 21:11

















  • where do you want to use this? in a save operation maybe? if you use this while a mysql-transaction is happening, this may be a problem

    – simonthesorcerer
    Sep 22 '17 at 21:11
















where do you want to use this? in a save operation maybe? if you use this while a mysql-transaction is happening, this may be a problem

– simonthesorcerer
Sep 22 '17 at 21:11





where do you want to use this? in a save operation maybe? if you use this while a mysql-transaction is happening, this may be a problem

– simonthesorcerer
Sep 22 '17 at 21:11










4 Answers
4






active

oldest

votes


















0














You do not need to use Mage API to get the table name.



Try this please:



$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
$query = "INSERT INTO `toynav_referral` (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);


Let me know if this worked!






share|improve this answer


















  • 1





    The way it was done in the question is best practice. It allows for customised or dynamic table names for models. Aside from that, this answer doesn't change anything in terms of the problem in the question

    – Robbie Averill
    Jul 4 '16 at 9:02











  • @RobbieAverill Well, as for solving the problem, I did not say it was the solution, but as for using the "getTableName" function I believe this is not the best method since this function was specifically built for this kind of use: "getTableName('catalog/product')" and not for tables that developer creates himself. And aside from that, I was just trying to help out and regarding your comment why don't you just try to help instead of criticizing negatively what others do?

    – Paul
    Jul 4 '16 at 9:06












  • Even if I used direct table name it's not changing anything at all.

    – Rinto George
    Jul 4 '16 at 9:08











  • @duke sorry, I thought this would help, I'll try to look for a solution for your problem. Can you please tell me in which context are you trying to use this query? An extension, module, CMS page?

    – Paul
    Jul 4 '16 at 9:10



















0














Try to begin transaction and then commit it.



$resource = Mage::getSingleton('core/resource');
$connection = $resource->getConnection('core_write');
$table = $resource->getTableName('toynav_referral');

try

$connection->beginTransaction();

$query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
$connection->query($query);

$connection->commit();

catch (Exception $e)

$connection->rollBack();






share|improve this answer























  • Still same result

    – Rinto George
    Jul 5 '16 at 4:47











  • I am not sure whats blocking me from committing.

    – Rinto George
    Jul 5 '16 at 5:58











  • Please add exception logging ...}catch (Exception $e) $connection->rollBack(); Mage::logException($e);

    – Neklo.com
    Jul 5 '16 at 11:18












  • Or try to use the Zend_Db 'insert' statement try $connection->beginTransaction(); $data = array( 'referral_id' => $id, 'email' => $email, 'coupon' => $couponCode, ); $connection->insert($table, $data); catch (Exception $e) $connection->rollBack(); Mage::logException($e);

    – Neklo.com
    Jul 5 '16 at 11:35


















0














Try to Make an log like below...



Mage::log(var_export($query, TRUE), null,'query.log');
Mage::log(var_export($connection,TRUE),null,'connection.log');





share|improve this answer






























    0














    There is no issue with your block of code.



    I believe this error is happening because this perticular block is being run in the midst of a higher level transaction.



    The solution to you problem is putting this block of code either before the beginning of the transaction or after the transaction is being commited.



    Cheers!






    share|improve this answer























      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "479"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f124071%2fdirect-sql-query-in-magento-not-working%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      You do not need to use Mage API to get the table name.



      Try this please:



      $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
      $query = "INSERT INTO `toynav_referral` (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
      $connection->query($query);


      Let me know if this worked!






      share|improve this answer


















      • 1





        The way it was done in the question is best practice. It allows for customised or dynamic table names for models. Aside from that, this answer doesn't change anything in terms of the problem in the question

        – Robbie Averill
        Jul 4 '16 at 9:02











      • @RobbieAverill Well, as for solving the problem, I did not say it was the solution, but as for using the "getTableName" function I believe this is not the best method since this function was specifically built for this kind of use: "getTableName('catalog/product')" and not for tables that developer creates himself. And aside from that, I was just trying to help out and regarding your comment why don't you just try to help instead of criticizing negatively what others do?

        – Paul
        Jul 4 '16 at 9:06












      • Even if I used direct table name it's not changing anything at all.

        – Rinto George
        Jul 4 '16 at 9:08











      • @duke sorry, I thought this would help, I'll try to look for a solution for your problem. Can you please tell me in which context are you trying to use this query? An extension, module, CMS page?

        – Paul
        Jul 4 '16 at 9:10
















      0














      You do not need to use Mage API to get the table name.



      Try this please:



      $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
      $query = "INSERT INTO `toynav_referral` (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
      $connection->query($query);


      Let me know if this worked!






      share|improve this answer


















      • 1





        The way it was done in the question is best practice. It allows for customised or dynamic table names for models. Aside from that, this answer doesn't change anything in terms of the problem in the question

        – Robbie Averill
        Jul 4 '16 at 9:02











      • @RobbieAverill Well, as for solving the problem, I did not say it was the solution, but as for using the "getTableName" function I believe this is not the best method since this function was specifically built for this kind of use: "getTableName('catalog/product')" and not for tables that developer creates himself. And aside from that, I was just trying to help out and regarding your comment why don't you just try to help instead of criticizing negatively what others do?

        – Paul
        Jul 4 '16 at 9:06












      • Even if I used direct table name it's not changing anything at all.

        – Rinto George
        Jul 4 '16 at 9:08











      • @duke sorry, I thought this would help, I'll try to look for a solution for your problem. Can you please tell me in which context are you trying to use this query? An extension, module, CMS page?

        – Paul
        Jul 4 '16 at 9:10














      0












      0








      0







      You do not need to use Mage API to get the table name.



      Try this please:



      $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
      $query = "INSERT INTO `toynav_referral` (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
      $connection->query($query);


      Let me know if this worked!






      share|improve this answer













      You do not need to use Mage API to get the table name.



      Try this please:



      $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
      $query = "INSERT INTO `toynav_referral` (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
      $connection->query($query);


      Let me know if this worked!







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Jul 4 '16 at 9:01









      PaulPaul

      23817




      23817







      • 1





        The way it was done in the question is best practice. It allows for customised or dynamic table names for models. Aside from that, this answer doesn't change anything in terms of the problem in the question

        – Robbie Averill
        Jul 4 '16 at 9:02











      • @RobbieAverill Well, as for solving the problem, I did not say it was the solution, but as for using the "getTableName" function I believe this is not the best method since this function was specifically built for this kind of use: "getTableName('catalog/product')" and not for tables that developer creates himself. And aside from that, I was just trying to help out and regarding your comment why don't you just try to help instead of criticizing negatively what others do?

        – Paul
        Jul 4 '16 at 9:06












      • Even if I used direct table name it's not changing anything at all.

        – Rinto George
        Jul 4 '16 at 9:08











      • @duke sorry, I thought this would help, I'll try to look for a solution for your problem. Can you please tell me in which context are you trying to use this query? An extension, module, CMS page?

        – Paul
        Jul 4 '16 at 9:10













      • 1





        The way it was done in the question is best practice. It allows for customised or dynamic table names for models. Aside from that, this answer doesn't change anything in terms of the problem in the question

        – Robbie Averill
        Jul 4 '16 at 9:02











      • @RobbieAverill Well, as for solving the problem, I did not say it was the solution, but as for using the "getTableName" function I believe this is not the best method since this function was specifically built for this kind of use: "getTableName('catalog/product')" and not for tables that developer creates himself. And aside from that, I was just trying to help out and regarding your comment why don't you just try to help instead of criticizing negatively what others do?

        – Paul
        Jul 4 '16 at 9:06












      • Even if I used direct table name it's not changing anything at all.

        – Rinto George
        Jul 4 '16 at 9:08











      • @duke sorry, I thought this would help, I'll try to look for a solution for your problem. Can you please tell me in which context are you trying to use this query? An extension, module, CMS page?

        – Paul
        Jul 4 '16 at 9:10








      1




      1





      The way it was done in the question is best practice. It allows for customised or dynamic table names for models. Aside from that, this answer doesn't change anything in terms of the problem in the question

      – Robbie Averill
      Jul 4 '16 at 9:02





      The way it was done in the question is best practice. It allows for customised or dynamic table names for models. Aside from that, this answer doesn't change anything in terms of the problem in the question

      – Robbie Averill
      Jul 4 '16 at 9:02













      @RobbieAverill Well, as for solving the problem, I did not say it was the solution, but as for using the "getTableName" function I believe this is not the best method since this function was specifically built for this kind of use: "getTableName('catalog/product')" and not for tables that developer creates himself. And aside from that, I was just trying to help out and regarding your comment why don't you just try to help instead of criticizing negatively what others do?

      – Paul
      Jul 4 '16 at 9:06






      @RobbieAverill Well, as for solving the problem, I did not say it was the solution, but as for using the "getTableName" function I believe this is not the best method since this function was specifically built for this kind of use: "getTableName('catalog/product')" and not for tables that developer creates himself. And aside from that, I was just trying to help out and regarding your comment why don't you just try to help instead of criticizing negatively what others do?

      – Paul
      Jul 4 '16 at 9:06














      Even if I used direct table name it's not changing anything at all.

      – Rinto George
      Jul 4 '16 at 9:08





      Even if I used direct table name it's not changing anything at all.

      – Rinto George
      Jul 4 '16 at 9:08













      @duke sorry, I thought this would help, I'll try to look for a solution for your problem. Can you please tell me in which context are you trying to use this query? An extension, module, CMS page?

      – Paul
      Jul 4 '16 at 9:10






      @duke sorry, I thought this would help, I'll try to look for a solution for your problem. Can you please tell me in which context are you trying to use this query? An extension, module, CMS page?

      – Paul
      Jul 4 '16 at 9:10














      0














      Try to begin transaction and then commit it.



      $resource = Mage::getSingleton('core/resource');
      $connection = $resource->getConnection('core_write');
      $table = $resource->getTableName('toynav_referral');

      try

      $connection->beginTransaction();

      $query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
      $connection->query($query);

      $connection->commit();

      catch (Exception $e)

      $connection->rollBack();






      share|improve this answer























      • Still same result

        – Rinto George
        Jul 5 '16 at 4:47











      • I am not sure whats blocking me from committing.

        – Rinto George
        Jul 5 '16 at 5:58











      • Please add exception logging ...}catch (Exception $e) $connection->rollBack(); Mage::logException($e);

        – Neklo.com
        Jul 5 '16 at 11:18












      • Or try to use the Zend_Db 'insert' statement try $connection->beginTransaction(); $data = array( 'referral_id' => $id, 'email' => $email, 'coupon' => $couponCode, ); $connection->insert($table, $data); catch (Exception $e) $connection->rollBack(); Mage::logException($e);

        – Neklo.com
        Jul 5 '16 at 11:35















      0














      Try to begin transaction and then commit it.



      $resource = Mage::getSingleton('core/resource');
      $connection = $resource->getConnection('core_write');
      $table = $resource->getTableName('toynav_referral');

      try

      $connection->beginTransaction();

      $query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
      $connection->query($query);

      $connection->commit();

      catch (Exception $e)

      $connection->rollBack();






      share|improve this answer























      • Still same result

        – Rinto George
        Jul 5 '16 at 4:47











      • I am not sure whats blocking me from committing.

        – Rinto George
        Jul 5 '16 at 5:58











      • Please add exception logging ...}catch (Exception $e) $connection->rollBack(); Mage::logException($e);

        – Neklo.com
        Jul 5 '16 at 11:18












      • Or try to use the Zend_Db 'insert' statement try $connection->beginTransaction(); $data = array( 'referral_id' => $id, 'email' => $email, 'coupon' => $couponCode, ); $connection->insert($table, $data); catch (Exception $e) $connection->rollBack(); Mage::logException($e);

        – Neklo.com
        Jul 5 '16 at 11:35













      0












      0








      0







      Try to begin transaction and then commit it.



      $resource = Mage::getSingleton('core/resource');
      $connection = $resource->getConnection('core_write');
      $table = $resource->getTableName('toynav_referral');

      try

      $connection->beginTransaction();

      $query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
      $connection->query($query);

      $connection->commit();

      catch (Exception $e)

      $connection->rollBack();






      share|improve this answer













      Try to begin transaction and then commit it.



      $resource = Mage::getSingleton('core/resource');
      $connection = $resource->getConnection('core_write');
      $table = $resource->getTableName('toynav_referral');

      try

      $connection->beginTransaction();

      $query = "INSERT INTO $table (`referral_id`,`email`,`coupon`) VALUES ('1', '2', '3')";
      $connection->query($query);

      $connection->commit();

      catch (Exception $e)

      $connection->rollBack();







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Jul 4 '16 at 19:02









      Neklo.comNeklo.com

      2,2991618




      2,2991618












      • Still same result

        – Rinto George
        Jul 5 '16 at 4:47











      • I am not sure whats blocking me from committing.

        – Rinto George
        Jul 5 '16 at 5:58











      • Please add exception logging ...}catch (Exception $e) $connection->rollBack(); Mage::logException($e);

        – Neklo.com
        Jul 5 '16 at 11:18












      • Or try to use the Zend_Db 'insert' statement try $connection->beginTransaction(); $data = array( 'referral_id' => $id, 'email' => $email, 'coupon' => $couponCode, ); $connection->insert($table, $data); catch (Exception $e) $connection->rollBack(); Mage::logException($e);

        – Neklo.com
        Jul 5 '16 at 11:35

















      • Still same result

        – Rinto George
        Jul 5 '16 at 4:47











      • I am not sure whats blocking me from committing.

        – Rinto George
        Jul 5 '16 at 5:58











      • Please add exception logging ...}catch (Exception $e) $connection->rollBack(); Mage::logException($e);

        – Neklo.com
        Jul 5 '16 at 11:18












      • Or try to use the Zend_Db 'insert' statement try $connection->beginTransaction(); $data = array( 'referral_id' => $id, 'email' => $email, 'coupon' => $couponCode, ); $connection->insert($table, $data); catch (Exception $e) $connection->rollBack(); Mage::logException($e);

        – Neklo.com
        Jul 5 '16 at 11:35
















      Still same result

      – Rinto George
      Jul 5 '16 at 4:47





      Still same result

      – Rinto George
      Jul 5 '16 at 4:47













      I am not sure whats blocking me from committing.

      – Rinto George
      Jul 5 '16 at 5:58





      I am not sure whats blocking me from committing.

      – Rinto George
      Jul 5 '16 at 5:58













      Please add exception logging ...}catch (Exception $e) $connection->rollBack(); Mage::logException($e);

      – Neklo.com
      Jul 5 '16 at 11:18






      Please add exception logging ...}catch (Exception $e) $connection->rollBack(); Mage::logException($e);

      – Neklo.com
      Jul 5 '16 at 11:18














      Or try to use the Zend_Db 'insert' statement try $connection->beginTransaction(); $data = array( 'referral_id' => $id, 'email' => $email, 'coupon' => $couponCode, ); $connection->insert($table, $data); catch (Exception $e) $connection->rollBack(); Mage::logException($e);

      – Neklo.com
      Jul 5 '16 at 11:35





      Or try to use the Zend_Db 'insert' statement try $connection->beginTransaction(); $data = array( 'referral_id' => $id, 'email' => $email, 'coupon' => $couponCode, ); $connection->insert($table, $data); catch (Exception $e) $connection->rollBack(); Mage::logException($e);

      – Neklo.com
      Jul 5 '16 at 11:35











      0














      Try to Make an log like below...



      Mage::log(var_export($query, TRUE), null,'query.log');
      Mage::log(var_export($connection,TRUE),null,'connection.log');





      share|improve this answer



























        0














        Try to Make an log like below...



        Mage::log(var_export($query, TRUE), null,'query.log');
        Mage::log(var_export($connection,TRUE),null,'connection.log');





        share|improve this answer

























          0












          0








          0







          Try to Make an log like below...



          Mage::log(var_export($query, TRUE), null,'query.log');
          Mage::log(var_export($connection,TRUE),null,'connection.log');





          share|improve this answer













          Try to Make an log like below...



          Mage::log(var_export($query, TRUE), null,'query.log');
          Mage::log(var_export($connection,TRUE),null,'connection.log');






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jun 13 '18 at 12:13









          MR.R DNATHMR.R DNATH

          31617




          31617





















              0














              There is no issue with your block of code.



              I believe this error is happening because this perticular block is being run in the midst of a higher level transaction.



              The solution to you problem is putting this block of code either before the beginning of the transaction or after the transaction is being commited.



              Cheers!






              share|improve this answer



























                0














                There is no issue with your block of code.



                I believe this error is happening because this perticular block is being run in the midst of a higher level transaction.



                The solution to you problem is putting this block of code either before the beginning of the transaction or after the transaction is being commited.



                Cheers!






                share|improve this answer

























                  0












                  0








                  0







                  There is no issue with your block of code.



                  I believe this error is happening because this perticular block is being run in the midst of a higher level transaction.



                  The solution to you problem is putting this block of code either before the beginning of the transaction or after the transaction is being commited.



                  Cheers!






                  share|improve this answer













                  There is no issue with your block of code.



                  I believe this error is happening because this perticular block is being run in the midst of a higher level transaction.



                  The solution to you problem is putting this block of code either before the beginning of the transaction or after the transaction is being commited.



                  Cheers!







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Sep 26 '18 at 14:23









                  Martin J.Martin J.

                  133




                  133



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Magento Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f124071%2fdirect-sql-query-in-magento-not-working%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Best approach to update all entries in a list that is paginated?Best way to add items to a paginated listChoose Your Country: Best Usability approachUpdate list when a user is viewing the list without annoying themWhen would the best day to update your webpage be?What should happen when I add a Row to a paginated, sorted listShould I adopt infinite scrolling or classical pagination?How to show user that page objects automatically updateWhat is the best location to locate the comments section in a list pageBest way to combine filtering and selecting items in a listWhen one of two inputs must be updated to satisfy a consistency criteria, which should you update (if at all)?

                      Тонконіг бульбистий Зміст Опис | Поширення | Екологія | Господарське значення | Примітки | Див. також | Література | Джерела | Посилання | Навігаційне меню1114601320038-241116202404kew-435458Poa bulbosaЭлектронный каталог сосудистых растений Азиатской России [Електронний каталог судинних рослин Азіатської Росії]Малышев Л. Л. Дикие родичи культурных растений. Poa bulbosa L. - Мятлик луковичный. [Малишев Л. Л. Дикі родичи культурних рослин. Poa bulbosa L. - Тонконіг бульбистий.]Мятлик (POA) Сем. Злаки (Мятликовые) [Тонконіг (POA) Род. Злаки (Тонконогові)]Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Description from Flora of China) [Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Опис від Флора Китаю)]Poa bulbosa L. – lipnice cibulkatá / lipnica cibulkatáPoa bulbosa в базі даних Poa bulbosa на сайті Poa bulbosa в базі даних «Global Biodiversity Information Facility» (GBIF)Poa bulbosa в базі даних «Euro + Med PlantBase» — інформаційному ресурсі для Євро-середземноморського розмаїття рослинPoa bulbosa L. на сайті «Плантариум»

                      Вунгтау (аеропорт) Загальні відомості | Див. також | Посилання | Навігаційне меню10°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.0833310°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.083337731608Vinh AirportVinh airport facelift improves serviceвиправивши або дописавши їївиправивши або дописавши їїр