PHP code example of virgiliopontes / autowheremysql

1. Go to this page and download the library: Download virgiliopontes/autowheremysql library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

virgiliopontes / autowheremysql example snippets



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

    }
}