Magento – Creating a module with custom database table, cannot save

databasemagento-1.9modelmodule

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!

Best Answer

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