function parseMysqlQuery($array) {
$output = ''; foreach( $array as $key => $value){
$output .= !$output ? " WHERE $table.$key " : " AND $table.$key";
$output .= ' IN ("' . implode('","', $value) . '")';
}
echo "Key: $key; Value: $value<br />\n";
return $output;
}
$array = (array)filter_input_array(INPUT_POST, array( "num" => array( 'filter' => FILTER_SANITIZE_STRING, 'flags' => FILTER_FORCE_ARRAY, ),
'grupo' => array(
'filter' => FILTER_SANITIZE_STRING,
'flags' => FILTER_FORCE_ARRAY,
),
'dt_de_inducao' => array(
'filter' => FILTER_SANITIZE_STRING,
'flags' => FILTER_FORCE_ARRAY,
),
));
//SELECT TABLE_NAME FROM information_schema.tables WHERE table_schema = 'folha_tarefa' if ($_SERVER['REQUEST_METHOD'] == "POST") { $array = array_filter($array);
$in = parseMysqlQuery($array);
$query = "SELECT * FROM contratos " . $in;
This is a filter with checkbox, but I have a search that I do a join left and I'm not able to make my php understand what table to look for, ex nameable.nomecolumn