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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:03:57+00:00 2026-06-13T13:03:57+00:00

i added two new columns in my db table, and then i defined these

  • 0

i added two new columns in my db table, and then i defined these new columns in the table model itself, and then, when i called

$model->getAttributes()

the two new columns didn’t appear in the array output of $model->getAttributes() method call

there’s no schema caching set in my configs,
any idea how to solve this?, and how am I gonna get the value of the input forms
of the new added columns from the front-end if i have a problem in showing off the two newly added columns ?

e.g

new columns
INHOUSE
OUTHOUSE

//view

 <?php echo $form->checkBox($model,'INHOUSE',array("id"=>"inhouse","value"=>1, "uncheckValue"=>0));?>
 <?php echo $form->checkBox($model,'OUTHOUSE',array("id"=>"outhouse","value"=>1, "uncheckValue"=>0));?>

//controller update action

i tried to save the value of the INHOUSE and OUTHOUSE didn’t get saved when i do

$model->attributes = $_POST['users'];
$model->save();

NOR

$model->INHOUSE = $_POST['users']['INHOUSE'];
$model->OUTHOUSE = $_POST['users']['OUTHOUSE'];
$model->save;

any ideas how to solve all those problems?

  • 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-13T13:03:58+00:00Added an answer on June 13, 2026 at 1:03 pm

    1-Can you insert data directly into your DB on those columns?
    2-Can you view those columns on the admin view or on any other view?
    3-Can you retrieve those values using a getColumn method?

    If not, try this:

    Make sure that you have the new columns specified in your model and view

    Model_Name.php

    public function attributeLabels()
    {
        return array(
            'id' => 'ID', // example
            'new_column' => 'New Column',
            ...
        );
    }
    

    You should also check from TOP to bottom and as a good practice you should also type this on the top of the model

     * @property integer $id //example
     * @property data_type $new_column
    ...
    

    Then to view your new columns you need to add them to the necessary views.

    example

    VIEW.PHP

    $this->widget('zii.widgets.CDetailView', array(
        'data'=>$model,
        'attributes'=>array(
             'id',
             'new_column',
              ...
    

    If you have your model with all these definitions you should be able to retrieve those values from the DB, re-check any custom functions that you may have.

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

Sidebar

Related Questions

I created a User defined table type named tvp_Shipment with two columns (id and
Two new keywords added to the C# 5.0 language are async and await ,
My storyboard seems locked. I have added new labels and imageviews to two different
I have a table where I have added a new column, and I want
I have two table where two column are fixed. Some columns are identical and
I have a very simple table with two string columns marked unique. Can anyone
I created one linear layout and I have added two relative layout. I wish
I've a problem with the ScrollViews in Titanium in an iOS-app: I added two
I have a gridview that displays items details, I added two template fields one
I added to my system-wide /etc/security/limits.conf the following two rows: * soft rtprio 55

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.