0

I have developed a custom module that also has a custom database table. However, I cannot insert records since I am presented with the following error:

Fatal error: Call to a member function beginTransaction() on boolean in /httpdocs/includes/src/__default.php on line 6105

Here is the code that I am trying:

$data = array(
          'voucher'     => 'voucher',
          'customer_name' => 'customer_name',
          'order'           => 'order',
          'value'           => 'value',
          'status'      => 1,
          'date'            => '',
        );
$model = Mage::getModel('antikatavoles/antikatavoles')->setData($data);

And this is my config file:

<?xml version="1.0" ?>
<config>

<modules>
    <ID_Antikatavoles>
        <version>0.1.0</version>
    </ID_Antikatavoles>
</modules>

<frontend>
    <routers>
        <antikatavoles>
            <use>standard</use>
            <args>
                <module>ID_Antikatavoles</module>
                <frontName>antikatavoles</frontName>
            </args>
        </antikatavoles>
    </routers>
</frontend>  
<global>
    <models>
        <antikatavoles>
            <class>ID_Antikatavoles_Model</class>
            <resourceModel>antikatavoles_mysql4</resourceModel>
        </antikatavoles>
        <antikatavoles_mysql4>
            <class>ID_Antikatavoles_Model_Mysql4</class>
            <entities>
                <antikatavoles>
                    <table>antikatavoles</table>
                </antikatavoles>
            </entities>
        </antikatavoles_mysql4>
    </models>
    <resources>
        <antikatavoles_setup>
            <setup>
                <module>ID_Antikatavoles</module>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </antikatavoles_setup>
        <antikatavoles_write>
            <connection>
                <use>core_write</use>
            </connection>
        </antikatavoles_write>
        <antikatavoles_read>
            <connection>
                <use>core_read</use>
            </connection>
        </antikatavoles_read>
    </resources>
    <helpers>
        <antikatavoles>
            <class>ID_Antikatavoles_Helper</class>
        </antikatavoles>
    </helpers>
</global>

</config>

Can anyone help me figure this one out?

thanks!

1
  • you should disable the Magento compiler when you install a new module Commented Sep 22, 2017 at 18:13

3 Answers 3

1

You have compilation mode turned on but the module doesn't have the src compiled for compilation mode.

Also, remove the mysql4 deprecated since 2010 stuff lol

0

You have to do like below

$post = $this->getRequest()->getPost();
$model = Mage::getModel('student/student')->setData(); 
$data = array('name'=>$post['name'],
                         'gender'=>$post['gender'],
                         );
$model->setData($data);
$model->save();
-1
  1. You have compilation mode turned on.
  2. Stop it and re-compile it.

We should not use compilation mode in development.

1
  • 1
    who down voted this ? what is wrong in this answer ? Commented Sep 14, 2018 at 6:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.