please help me, i want to make search query but list of table is not shown in php but it work in mysql..here is my code
//$sql = "SELECT * FROM table_name WHERE 1=1" work perfectly
$sql = "SELECT a.* FROM (SELECT table_name FROM information_schema.tables WHERE table_schema like 'rft%') a where 1=1";
if( !empty($requestData['search']['value']) )
{ // if there is a search parameter, $requestData['search']['value'] contains search parameter
//search based on input
$sql.=" AND ( Code LIKE '".$requestData['search']['value']."%' ";
$sql.=" OR Year LIKE '".$requestData['search']['value']."%' )";
}
//start search after input
$query=mysqli_query($conn, $sql) or die("employee-grid-data.php: get employees");
$totalFiltered = mysqli_num_rows($query);
continue here
// when there is a search parameter then we have to modify total number filtered rows as per search result.
$sql.=" ORDER BY ". $columns[$requestData['order'][0]['column']]." ".$requestData['order'][0]['dir']." LIMIT ".$requestData['start']." ,".$requestData['length']." ";
/* $requestData['order'][0]['column'] contains colmun index, $requestData['order'][0]['dir'] contains order such as asc/desc */
$query=mysqli_query($conn, $sql) or die("employee-grid-data.php: get employees");
$data = array();
while( $row=mysqli_fetch_array($query) )
{ // preparing an array
$nestedData=array();
$nestedData[] = $row["Type"];
$nestedData[] = $row["Code"];
$nestedData[] = $row["Year"];
$data[] = $nestedData;
}