gpt4 book ai didi

mysql - 我如何使用 mysql 在 Laravel 的大型数据库中快速搜索特定 ID 并获取该 ID 的所有行?

转载 作者:行者123 更新时间:2023-11-30 21:53:28 25 4
gpt4 key购买 nike

我正在 Laravel 中制作结果发布系统应用程序。我正在 MYSQL 数据库中导入大量学生结果(如 1000000)。学生可以通过角色编号和注册编号搜索结果。我将提供两个输入,需要搜索整个结果数据库并找到学生的结果。我应该如何搜索结果以便快速找到搜索结果。谢谢

最佳答案

<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);

关于mysql - 我如何使用 mysql 在 Laravel 的大型数据库中快速搜索特定 ID 并获取该 ID 的所有行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46152570/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com