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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:20:41+00:00 2026-05-15T13:20:41+00:00

In my mode I am selecting a field as $query1 = $this->db->query(SELECT dPassword FROM

  • 0

In my mode I am selecting a field as

$query1 = $this->db->query("SELECT dPassword 
                    FROM tbl_login
                    WHERE  dEmailID='a@a.in'");

How to return dpassword as a variable to my controller
I tried this way return dpassword;

  • 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-05-15T13:20:41+00:00Added an answer on May 15, 2026 at 1:20 pm

    The following is also fine:

    if($query1->num_rows() > 0){
        $row = $query1->row();
    }
    return $row->dPassword;
    

    Then if your query was to return more than a single row you could operate on the results like so:

    foreach($query1->result() as $row){
    echo $row->field1;
    echo $row->field2;
    echo $row->etcetera;
    }
    

    For single row results i usually return the row directly from the model like so:

    return $query1->row();
    

    Here is an example of this:

    function select_provider_details($provider_id)
        {
            $this->db->select('*');
            $this->db->from('providers');
            $this->db->where('provider_id', $provider_id);
    
        $query = $this->db->get();
    
        if($query->num_rows() > 0)
        {
            $result['success'] = TRUE;
            $result['query'] = $query->row();
        }
        else
        {
            $result['success'] = FALSE;
            $result['error'] = "Provider not found in database";
            $result['errorcode'] = "E003";
            $result['query'] = $query->row();
        }
            return $result;
    }
    

    Or for a query expected to return multiple results i return the entire results object:

    return $query1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ess-mode is Emacs speaks statistics. This mode is useful for editing programs for R
When in incremental search mode in Intellij IDEA, is there a way to select
While using Vim, in visual mode, selecting text and then calling a colon command
Let's say you're using vim to select in visual mode. You hit v ,
In WPF Binding.Mode , when selecting Default , it depends in the property being
When we add a event to jquery fullcalendar (in selectable mode)on click or selecting
I am using emacs in ido-mode. When selecting a desired buffer, instead of the
Is there a way to set an Select Only Mode? I work with SQL
When selecting a row from the master view of UISPlitViewControler when its in popover
I am facing a problem where-in I cannot select videos from the photo album

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.