<?php
include('../config/dbcon.php');
$output = '';
if(isset($_POST["query"]))
{
	$search = mysqli_escape_string($connect, $_POST["query"]);
	$query = "select table_name, engine from information_schema.tables where table_type = 'BASE TABLE'  AND table_schema='venkatco_db' and Lower(table_name) LIKE Lower('%".$search."%')";}
else
{
	$query = "SELECT table_name, engine FROM information_schema.tables WHERE table_type = 'BASE TABLE' AND table_schema='venkatco_db' ORDER BY table_name ASC";
}
$result = mysqli_query($connect, $query);
if(mysqli_num_rows($result) > 0)
{
	$output .= '
	<div class="table-responsive" style="width: 100%;">
		<table id="tblexportData" style="float: left;" class="table table bordered" >
			<tr>
				<th style = "width:100px; text-align: left">Table_Names</th>
			</tr>';
	while($row = mysqli_fetch_array($result))
	{
		$output .= '
			<tr>
				<td style="text-align: left">' . $row["table_name"] . '</td>
			</tr>
		';
	}
	echo $output;
}
else
{
	echo 'Table Not Found';
}
?>
