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 7561435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:09:43+00:00 2026-05-30T13:09:43+00:00

I am new to Magento. I need two table in my custom module and

  • 0

I am new to Magento. I need two table in my custom module and I have to load two table as separate collection, ie Mage::getModel('mymodule/model1')->getcollection() and Mage::getModel('mymodule/model2')->getcollection()

I’ve followed the link posted here Magento – possible to have multiple tables for a single model? but I am stuck. I created two model classes “model1” and “model2”, and created same under the “mysql4”, my first model works fine, but if I accessed second one it’s not working.

How could I use multiple table in a single module?
Thanks in advance.


Here is my config.xml

<models>
    <module>
        <class>Package_Module_Model</class>
        <resourceModel>module_mysql4</resourceModel>
    </module>
    <module_type1>
        <class>Package_Module_Model_Type1</class>
        <resourceModel>module_mysql4</resourceModel>
    </module_type1>
    <module_mysql4>
        <class>Package_Module_Model_Mysql4</class>
        <entities>
            <module>
                <table>table1</table>
            </module>
            <module_type1>
                <table>table2</table>
            </module_type1>
        </entities>
    </module_mysql4>

  • 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-30T13:09:44+00:00Added an answer on May 30, 2026 at 1:09 pm

    You only have one module so only need one module declaration:

    <models>
        <module>
            <class>Package_Module_Model</class>
            <resourceModel>module_mysql4</resourceModel>
        </module>
        <module_mysql4>
            <class>Package_Module_Model_Mysql4</class>
            <entities>
                <model1>
                    <table>table1</table>
                </model1>
                <model2>
                    <table>table2</table>
                </model2>
            </entities>
        </module_mysql4>
    </models>
    

    Here there are several models in a single module’s entities list.

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

Sidebar

Related Questions

I need to create module in Magento which will have few database tables. One
I have recently created a new shipping module in Magento 1.3.2 with the aid
I'm new to Magento, and i need some conceptual guide and/or references. I need
I may just need a terminology update, but I have been playing in Magento
I've created a new product type and need to create and associate some custom
New to magento here, I have figured out how to use my local.xml to
I have a Magento installation with around 60 attribute sets. I need to add
I have to create a number of new stores inside my Magento installation. One
I am using Magento var-1.6 I need to add a new template(.html) file to
I want to add new column to the existing sales_flat_order table of magento. The

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.