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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:58:46+00:00 2026-06-15T21:58:46+00:00

I am creating project in yii framework. I am having table as- Qbquestion QbquestionOption

  • 0

I am creating project in yii framework. I am having table as-
Qbquestion QbquestionOption
-questionId -optionId
-question -questionId
-userId -option
-isPublished -isAnswer

In QbquestionOption controller i want to access Qbquestion tables fields. I had written quesry as-

 $Question=Qbquestion::model()->findAllByAttributes(array("questionId"=>$number));

where $number is some random number.
When i am using its fields as= $Question->isPublished then its giving error as “trying to get access to property of non-object”
Statement var_dump($Question) is showing all record and all values of Qbquestion table. So how can i access records?
Please help me

  • 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-15T21:58:47+00:00Added an answer on June 15, 2026 at 9:58 pm

    $Question is an array of models you cannot call model function on that..

    what you can do is:

     $questions = Qbquestion::model()->findAllByAttributes(array("questionId"=>$number));
     foreach($questions as $question)
        $question->isPublished()
    

    or you can use findByAttribute to get single result..

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

Sidebar

Related Questions

I am creating project in yii. I am having Poll table with the fields
When creating a project in applications/xampp/htdocs using the yii framework in terminal, it's showing
I am creating project in Yii framework. In controller i have function as- public
Im creating a project in Xcode using OpenCV as a framework. It works great
In yii i am creating project. After validation of user's entered email, i am
In yii i am creating project. Now i want to create widget for displaying
I'm creating a project in flex builder but it's not using the flex framework,
I am Creating SetUp Project for Win App. in VS2010 Framework 4.0 Now While
I am creating a project in struts2 I have created a Registration.jsp page like
I'm creating a project that consists on calling 'bake project' (using DispatchShell ) from

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.