I am trying to check whether a table exists in my database but I am always getting "You are in!" as output. The output of the if statement is not being displayed in the browser.
I appreciate any help.
$con = new mysqli ( 'localhost', 'root', '', 'bustracker' );
echo "You are in!";
if($con->connect_errno){
die ( "connection problem!".$con->connect_error);
}
//check whether route's table exists.
$results = $con->query("SHOW TABLES LIKE '".$route."'");
if( ($results->num_rows) == 1){
echo "Table exist";
}else{
echo "table does not exist";
}