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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:35:53+00:00 2026-06-15T08:35:53+00:00

I wanted to ask is it possible to specify a where clause after a

  • 0

I wanted to ask is it possible to specify a where clause after a join in order to match data to a users input. Say for example I have the following code:

 $this->db->select('user.*,role.*')
  $this->db->from('user');
  $this->db->where('user.username', $username);
  $this->db->where('user.password', $password);
  $this->db->join('role','role.id = user.role_id')
  $result = $this->db->get();

and I want to query the matching data from the table ‘role’:

 $this->db->select('user.*,role.*')
  $this->db->from('user');
  $this->db->where('user.username', $username);
  $this->db->where('user.password', $password);
  $this->db->join('role','role.id = user.role_id')
  $this->db->where('role.speaker', $speaker); //want to know if this is correct
  $result = $this->db->get();

Is this possible? Can I compare results (using WHERE) after a JOIN? Will that produce results matching to the WHERE clause?

Thanks!

  • 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-15T08:35:54+00:00Added an answer on June 15, 2026 at 8:35 am

    CodeIgniter doesn’t actually build the query until ->get() is called. You can call the methods in whatever order you want.

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

Sidebar

Related Questions

I just wanted to ask. I have text input to allow users to type
I wanted to ask is it possible to Show Directions in Map View (Bing)
I wanted to ask whether it is possible to get the correct sizes of
I wanted to ask if the following scenario is somehow possible to happen. I
I'm assuming this isn't possible, but wanted to ask in case it is. If
From what I can tell, this is not possible, but I wanted to ask
I'm almost sure this is not possible, but just wanted to ask if I'm
I just wanted to ask if it's possible to create a shopping cart with
I wanted to ask if its possible to hook up sortable to table elements.
today I came across the Path App: And wanted to ask if its possible

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.