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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:21:30+00:00 2026-06-11T20:21:30+00:00

I have 3 tables namely users, items and purchase. Purchase hasMany(‘Users’) and hasMany(‘Item’). Now

  • 0

I have 3 tables namely users, items and purchase.

Purchase hasMany(‘Users’) and hasMany(‘Item’). Now when you

class Model_Purchase extends Model_Table {
public $table = 'purchase';
function init(){
    parent::init();

    $this->hasMany('Users');
    $this->hasMany('Item');


    $users = $this->join('users.id', 'users_id', 'left' );
    $users->addField('user_name');

    $users = $this->join('item.id', 'item_id', 'left' );
    $users->addField('item_name');

}
}

Now, when i click on the ‘Add’ a form opens with text fields. What i want is a dropdown list of all users and all items over there.

Do i need to implement it by querying each table seperately and selecting users from one table then selecting items from other table ?

And how can i make changes in that ‘CRUD’ popup?

Here is the reference URL, to check my implementation : http://qambarraza.com/projects/purchaseitem/?page=purchase

Thanks,

Qambar Raza

  • 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-06-11T20:21:32+00:00Added an answer on June 11, 2026 at 8:21 pm

    In your case purchase hasOne item and hasOne user. This should give you the popups.

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

Sidebar

Related Questions

I have 3 tables namely: Town; Village; Farmers...and I need to COUNT how many
My prob in brief: I have two tables namely category and product. table: category
I have a database with three tables in my database namely catering, room, room_booking
I have an abstract class User and 2 classes which inherit from it, namely
I have three tables namely test1, test2, test3 test1 data =========== id test_id q_id
newbie programmer here. I have 3 tables namely product, category, and subcategory. I configured
MY PLATFORM: PHP & mySQL WHAT I HAVE HERE: I have 4 tables, namely,
I have two tables, namely Price List (Table A) and Order Record (Table B)
I have two tables namely Stuff and Boss. Based on the slug(user_type) from the
I have two columns in table users namely registerDate and lastVisitDate which consist of

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.