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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:10:13+00:00 2026-06-08T19:10:13+00:00

Is it possible in CodeIgniter or PHP to extend a MySQL statement. For example.

  • 0

Is it possible in CodeIgniter or PHP to extend a MySQL statement. For example. If I have $query1. Can I add onto $query1 in another $this->db->query() instance:

$query1 = this->db->query("SELECT * FROM users WHERE a = b");

$query1(or 2) = $this->db->query("AND b = c");
  • 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-08T19:10:14+00:00Added an answer on June 8, 2026 at 7:10 pm

    Put your statement in a var and extend the string if need:

    $strStatement = "SELECT * FROM users WHERE a = b";
    
    if ( /* whatever */ )
    {
        $strStatement .= " AND b = c";
    }
    
    $objResult = $this->db->query( $strStatement );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to write this query in codeigniter active records? $Main_Nav_Query = mysql_query(SELECT
Possible Duplicate: How can I understand nested ?: operators in PHP? Why does this:
I am using CodeIgniter, and basically a PHP noob. So I have this table
Possible Duplicate: Problem with database in CodeIgniter Alright, I've googled this the last two
Is it possible to add price values to product options in the Codeigniter Cart
I am using the CodeIgniter 2.1 PHP framework. I have a library file that
Sorry if this is a simple question, is it possible to load codeigniter without
I have two directories within my codeigniter controller. /controllers/admin/ dashboard.php content.php enquiries.php /controllers/members/ profile.php
Possible Duplicate: CodeIgniter Disallowed Key Characters Im trying to have a form submit to
Possible Duplicate: how to remove index.php from url in codeigniter ? I want to

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.