Thank you so much for this excellent question, nowhere to be found elsewhere on stackoverflow.
Here is the answer:
$result=$db->query($Sql); $Row=$result->fetch(); $TableNameFound=$Row['TABLE_NAME'];