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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:28:05+00:00 2026-05-13T13:28:05+00:00

In the codeigniter manual writes the following. $this->db->select() accepts an optional second parameter. If

  • 0

In the codeigniter manual writes the following.

$this->db->select() accepts an
optional second parameter. If you set
it to FALSE, CodeIgniter will not try
to protect your field or table names
with backticks. This is useful if you
need a compound select statement.

$this->db->select('(SELECT SUM(payments.amount) FROM payments 
WHERE payments.invoice_id=4) AS amount_paid', FALSE);
$query = $this->db->get('mytable');
...

And I have the following code from one of CI applications.

$this->db->select('slug, type, 
IF(`value` = "", `default`, `value`) as `value`', FALSE);

Q1. What are the differences between backtick ` and single quote ‘?

Q2. Can I use IF statement in a query as above?

Q3. What does this mean?

IF(`value` = "", `default`, `value`) as `value`
  • 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-13T13:28:05+00:00Added an answer on May 13, 2026 at 1:28 pm
    1. In MySQL, backticks quote names, while single quotes create strings. If you have a column called select, MySQL would throw an syntax error when using this name without backticks — like in SELECT select FROM foo — as it would interpret it as keyword which may not occur there.

    2. This IF function can be used as a column specification in SELECT statements. See the MySQL reference.

    3. This function returns the value from the default column, if value is the empty string. Else it returns the value from value itself. The result will be called value. See the MySQL reference for details.

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

Sidebar

Related Questions

I have some code in Codeigniter that looks like this: $this->db->select('email_account_id'); $this->db->where('TRIM(LOWER(email_account_incoming_username))',trim(strtolower($email_address))); $query =
I use CodeIgniter as my web application framework. I used a simple Try/Catch and
I'm trying to build my first app on CodeIgniter. This is also my first
I'm trying to build my first app on CodeIgniter. This is also my first
The following line is giving an error message. $query = 'SELECT * FROM products
using the default pagination class, and following the odeigniter user manual i fail to
Codeigniter php framework URLs look like the above. I'm surprised that apache maps this
CodeIgniter has a method $this->load->vars($array) that is ideally used in the parent Controller to
I’ve read the manual on URI routing and views and something is not clicking
CodeIgniter allows access to POSTed data via: $this->input->post('input_name'); where 'input_name' is the name of

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.