Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Search Multiple columns using one input

 $req = request();
 if ($req->get('reference_no')){
            $advance_qry = $req->input('reference_no');
            $requestData = ['reference_no', 'agency_ref_no', 'status','property_status'];
            $query->where(function($q) use($requestData, $advance_qry) {
                foreach ($requestData as $field)
                    $q->orWhere($field, 'like', "%{$advance_qry}%");
            });

        }
Comment

PREVIOUS NEXT
Code Example
Php :: how can i get input id in laravel 8 
Php :: null coalesce operator in php (laravel) 
Php :: create json file in php and write n php 
Php :: change regards line laravel 
Php :: laravel 8 remove public from url 
Php :: laravel migration add contraint to other database 
Php :: how to fetch google reviews and data in php URl 
Php :: blocking youtube adds in php 
Php :: To enqueue css & js quickly 
Php :: php formula return more results 
Php :: php store html in varible 
Php :: how to use db more than 1 codeigiter 3 
Php :: Ajouter un texte par défaut sur toutes vos publications WordPress 
Php :: how to remove warning in php 
Php :: Detect Browsers Windows|Linux|Mac|Mobile PHP Code 
Php :: wc-notice-functions.php on line 140 
Php :: Syntax error or access violation: 1072 Key column doesnt exist in table laravel migrate 
Php :: datatables compactible with bootstrap v4 
Php :: PHP readfile() Function 
Php :: cors laravel 
Php :: comparison operators in php 
Php :: elasticsearch php search date range 
Php :: Wordpress srcset with ACF Image & lazy Load 
Php :: php retrieve data from database and show in text area greeper 
Php :: laravel form collective add asterisk 
Php :: reset internal pointer mysql query 
Php :: upload image to backend (see rest of the link) 
Php :: codeigniter get view as string 
Php :: laravel many to many relationship with pivot table 
Php :: Start composer on DAFP 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =