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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:36:51+00:00 2026-06-15T10:36:51+00:00

Objective : If the database returns the number 1 , then it redirects to

  • 0

Objective : If the database returns the number 1 , then it redirects to setup page, if it returns 2 , its redirect to setup page 2 if it returns 0 then it activates else statement

I have been trying this out for awhile but still seem to get it to work
My Controller :

    $user_id                 = array('id'=>$this->loggedInUser->id);
    $results                 = $this->user_model->getUsersStage($user_id);

    if($results == '1'){
    redirect('registration/setup');
    } 

My Model :

 function getUsersStage($conditions=array(),$fields='')
 {

    if(count($conditions)>0)        
        $this->db->where($conditions);

    $this->db->from('users');

    if($fields!=''){
    $this->db->select($fields);
    }
    else{
    $this->db->select('stage');
    }


    $result = $this->db->get();
    return $result;


 }//End of getUsersStage Function

Would be nice if you could let me know what went wrong, I tried lots of comparison method , like

if($results == 1){  
Error : Object of class CI_DB_mysql_result could not be converted to int
if(this->$results->stage == 1) 

just to verify, $this->loggedInUser is working and it does send the correct sql statement to the model.

  • 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-15T10:36:52+00:00Added an answer on June 15, 2026 at 10:36 am

    Change

    if($results == '1'){
        redirect('registration/setup');
        } 
    

    to

    if($results->row()->stage == 1){
        redirect('registration/setup');
        } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been programming objective-C for a few months now and have done pretty well
Objective: In support of a Windows Service that may have multiple instances on a
I have a database that is filled with information for films, which is (in
I'm new to Objective-C and I'd like to abstract my database access using a
I have a simple question about creating multiple initialisers within an objective-c class. Basically
I have not been using envers for very long, and i have hit a
I am having some trouble with objective c on iPhone. I have this method
I have been thinking about this problem for long enough but cannot come up
When I try to save a new entity to the database, I have the
I want to provide access an sqlite database in Objective C. I don't want

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.