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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:39:51+00:00 2026-06-16T04:39:51+00:00

According to the documentation, passing a third parameter of ‘none’ to the like method

  • 0

According to the documentation, passing a third parameter of ‘none’ to the like method should eliminate the use of wildcard characters in a like search query.

Im doing this, where $search == ‘test_username’:

$this->db->like('username', $search, 'none');
$this->db->limit(1);
$q = $this->db->get('customers')->row();
var_dump($this->db->last_query());exit;

I expect to see this echoed to the screen:

SELECT * FROM (`ci_customers`) WHERE `username` LIKE 'test_username' LIMIT 1

But I’m getting this instead:

SELECT * FROM (`ci_customers`) WHERE `username` LIKE '%test_username%' LIMIT 1

It seems like the method is ignoring the 3rd parameter or I’m doing something wrong. Any Ideas? I can just write out my query and use the query() method but I’m curious.

  • 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-16T04:39:52+00:00Added an answer on June 16, 2026 at 4:39 am

    It looks as though the code for the “none” is not included in the 2.1.0 version. Have a look at lines 649-692 on https://github.com/EllisLab/CodeIgniter/blob/v2.1.0/system/database/DB_active_rec.php#L639.

    and then look at line 664 of the 2.1.3 version: https://github.com/EllisLab/CodeIgniter/blob/2.1.3/system/database/DB_active_rec.php#L639

    You either need to upgrade, or add this to your DB_active_rec.php file:

    ...
    if ($side == 'none')
    {
      $like_statement = $prefix." $k $not LIKE '{$v}'";
    }
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to the documentation for -[UIView setNeedsLayout] : Because this method does not force
According to Android documentation, using the .getTime() method in the Android location will return
According to the documentation for NSString's method -UTF8String : The returned C string is
According to its API documentation , the Facebook.init() method allows you to pass an
According to documentation , On success, zero is returned but none of the functions
I want to use MDM to manage number of iOS devices. According to documentation
According to the documentation i would like to overwrite predefined formats using this settings:
I was looking into HTML:Element documentation and came across attr_get_i method which according to
According to documentation Default implementation does nothing. But... I throw exception from drawRect method
according documentation: On success, the function returns the converted integral number as a long

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.