Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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}%");
            });

        }
 
PREVIOUS NEXT
Tagged: #Search #Multiple #columns #input
ADD COMMENT
Topic
Name
8+9 =