virgiliopontes/autowheremysql
Composer 安装命令:
composer require virgiliopontes/autowheremysql
包简介
With this package, it's easy to create visions where your users become more powerful. You give them the power to filter fields all fields in a query, without the need to create each field separately.
README 文档
README
This package to create the where part of your MySQL queries from a simple form submission, and everything automatically.
Install
composer require virgiliopontes/autowheremysql
Examples
The Hello World example.
Go to the examples directory in the root of the repository (vendor/virgiliopontes/autowheremysql/examples).
Open the index.php with your favorite text editor and take a look at the source code.
Open the browser
Navigate to the directory where the index.php is allocated.
Exemple
http://127.0.0.1/vendor/virgiliopontes/autowheremysql/
Note: You need to replace 127.0.0.1 with the machine address where the example is
Installation
Composer
Install Composer if you don't have it.
composer require virgiliopontes/autowheremysql
Or in your composer.json file add:
{ "require": { "virgiliopontes/autowheremysql": "~2", } }
And the just run:
composer update
and thats it.
Using
Uses in Controller by adding use AutoWhere/AutoWhereMysql after namespace
<?php namespace App\Controllers; use AutoWhere\AutoWhereMysql; //<--- Here class YourClass { //... public function YourMethod() { $autoWhereMysql = new AutoWhere\AutoWhereMysql(); if(isset($_POST['campofiltro'])){ $where = $autoWhereMysql->make_where($_POST['campofiltro'],$_POST['operador'],$_POST['valorfiltro']); echo $where; } } }
Questions?
Call me on Twitter @virgiliopontes.
License
MIT
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-06-20