How can i quickly search a specific id and get all rows of that id in a large database in Laravel with mysql? -


i making result publishing system application in laravel . importing large number results (like 1000000) of students in mysql database. student can search there result role number , registration number. give 2 input , whole result database needed search , find result of student .how should approach searching result search result found quickly. thanks

<div class="btn-group">     <formclass="forminline" action="{{url::to('searchemployie')}}" method="get">          <div class="form-group">               <input type="text" name="search" class="form-control" id="search" placeholder="{{ trans('app.search_for_action')}}" value="{{request::get('search')}}">              <button type="submit" class="btn btn-outline btn-default"><i class="icon fa-search" aria-hidden="true"></i></button>              @if (request::get('search') != '')                 <a href="{{url::to('employie')}}" class="btn btn-outline btn-danger" type="button"><i class="icon fa-remove" aria-hidden="true"></i>                 </a>             @endif         </div>     </form> </div> 

controller

$q = input::get('search'); $employie = employie::where('employee_name', 'like', '%' . $q . '%')->paginate(2); 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -