Welcome Guest, Not a member yet? Register   Sign In
Running Where Clause with Like Not Working
#1

Hi guys please help. I'm trying to run a search on one of the tables where i use multiple likes and a where statement. Code below. Where is ignored in this query and thus returning all the data Like searchText in that table. How do i make sure the where clause is not ignored 

PHP Code:
//** */
    //** */
    //** SEARCH SERVICE PROVIDERS BY SEARCH KEYWORD */
    //** */
    //** */
    function getAllDriversLike($inputText,$companyId)
    {
        $db      = \Config\Database::connect();
        $builder $db->table('contractors');
        $builder->where('ccompanyId'$companyId);
        $builder->orLike('contractor_id'$inputText);
        $builder->orLike('ccontact'$inputText);
        $builder->orLike('cfirst_name'$inputText);
        $builder->orLike('clast_name'$inputText);
 

        $query $builder->get();
        
        
return $query->getResult();
    
Reply


Messages In This Thread
Running Where Clause with Like Not Working - by remesses_thegreat - 04-18-2023, 04:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB