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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:33:48+00:00 2026-06-14T10:33:48+00:00

I am totally new in Yii framework and quite frankly do not know everything

  • 0

I am totally new in Yii framework and quite frankly do not know everything about it. I have an ongoing project in which I am stuck in a problem.
I have 3 tables in the project. Here are the table names and the rows:

  1. Users (id, name, email, username, password, currentTIme) Uses for storing user information.

  2. Groups (id, name, currentTIme) Uses for storing Group Information.

  3. UserGroup (id, userId, groupId, currentTime) Uses for keeping the relation between user and group.

Now, what I have to do is after creating 3 models, Users and Groups model will be used for all users. Different groups was added like:

  1. CSE 02. EEE 03. BBA 04. Architecture etc. etc.

Now, when ‘User create’ portion 2 things have to happen. One, the group names (CSE, EEE, BBA, Architecture etc.) will be shown in a listbox to choose along with the user’s other information (name, password etc.). Now question is How I can show the name of Groups in a listbox in the model Users where there is no relationship.

Second problem is, when I will click ‘submit’ it will update 2 tables ‘Users’ and ‘UserGroup’. Name, password,currentTime will be saved in ‘User’ and userid(of current user), groupid(id of the groups user will be selected like 1 for CSE etc.) will be saved in ‘UserGroup’ table.

Thank you for tolerating my horrible English and any kind of comment/feedback will be a big help for me…..Thanks in advance

  • 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-14T10:33:49+00:00Added an answer on June 14, 2026 at 10:33 am

    I found out answer of the first part which shows the list from another model. For anybody like me, it can be useful i am posting it here.

    in the /models/users.php:

    class Users extends CActiveRecord
    {
    public $Groups;
    …………………..
    …………………..
    }

    in the /view/users/_form.php:

    <div class="row">
    <?php echo $form->labelEx($model,'Group'); ?>
    <?php
    echo $form->dropDownList($model, 'Groups',
    CHtml::listData(Groups::model()->findAll(),'id','name'));
    
    //echo $form->;dropDownList($model,'Groups', CHtml::listData(Groups::model()->findAll(), 'id', 'value'), array('empty'=>;'--please select--')); 
    ?>
    <?php echo $form->error($model,'password'); ?>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Totally new to programming so kindly excuse the silly question. I have this URL
Totally new to Capistrano. I have a local git repository that I want to
I'm totally new to AWS. I managed to have an instance that runs PHPMyAdmin.
I'm totally new in OpenCV so hopefully that's not a too stupid question. As
Totally new to Drupal so be gentle please! Let's say I have a number
I am totally new in building Visual Studio Project through a script, so feel
Totally new to Linux, have an Arch Linux machine up. What is the command
I'm totally new to Ruby but not to programming. All I did was going
I'm totally new to Flex (moving away from Java for now :(). I have
Alright totally new to jeditable, Say I have some <div> 's and <input type='hidden'

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.