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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:20:30+00:00 2026-05-24T23:20:30+00:00

I have two tables, User and Company . I have joining them like this:

  • 0

I have two tables, User and Company. I have joining them like this:

   $table = $this->getDbTable();
   $select = $table->select();
   $select->setIntegrityCheck( false );

   $select->from( array('User'), array( 'id' => 'id',
                                        'name' => 'User.name',
                                        'gender' => 'User.gender', 
                                        'Company_id' => 'User.Company_id' 
                                      ));

   $select->join( 'Company', 'Company.id = User.Company_id', 
                   array( 'Company_name' => 'Company.name' ,
                          'Company_address' => 'Company.address'
                         ));  

   $rows = $table->fetchAll( $select );

It is working and giving me accurate result. Problem is that I have to mentions column names in above codes. I want to get all columns without mentioning them in above piece of code.

For example I want something like this that get all columns(But it is not providing all column values):

   $table = $this->getDbTable();
   $select = $table->select();
   $select->setIntegrityCheck( false );
   $select->from( array('User') );
   $select->join( 'Company', 'Company.id = User.Company_id' );  
   $rows = $table->fetchAll( $select );

Thanks

  • 1 1 Answer
  • 1 View
  • 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-24T23:20:31+00:00Added an answer on May 24, 2026 at 11:20 pm

    Leaving away the second parameter to the from call should work: http://framework.zend.com/manual/en/zend.db.select.html#zend.db.select.building.columns

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

Sidebar

Related Questions

If i have two tables like user table-u userid | name 1 | lenova
I have two tables, user and company, and I have a combo box in
I have two tables user and treeview . From my registration form I wanna
I have two tables user and log. I would like to join the user
I have two tables in my database: user and media_contact . The media_contact table
I have two tables. User table has user_id and order_num Orders table has order_num,
I have two tables User & User Log . User log table basically logs
I have two tables user table user_id | name | 1 | peter |
I have two tables USER and TRANSACTION i want to choose the data from
I have two tables: 1- Device : 2- User: has foreign key to device,

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.