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

When in incremental search mode in Intellij IDEA, is there a way to select
How do I create a ListBox in ASP.NET MVC with single selection mode?
When using wireframe fill mode in Direct3D, all rectangular faces display a diagonal running
I have authentication mode set to forms in my asp.net web.config but am still
The Emacs cperl-mode seems to get confused less than perl-mode, but the Skittles effect
What is the Emacs mode or package that highlights Lisp forms changing the color
How full-screen mode, like in web browsers, for application running under Windows OS is
When in Insert Mode or Edit Mode of DetailsView, the default behavior of click
I like to use Emacs' shell mode, but it has a few deficiencies. One
If I need to choose a collation mode to work with, how do I

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.