PHP:
try
{
$sql_tablename=$connect_db->query("select *from tablename Where ID = '1' ");
if ($sql_tablename->rowCount()>0)
{
$srg_tablename = $sql_tablename->fetch(PDO::FETCH_ASSOC);
$read_columnname = $srg_tablename['columnname'];
}
}
catch(PDOException $e)
{
echo '
<div style="text-align:center;font-family:Arial;color:#CC0000;">Tables Not Found</div>';
$connect_db = null;
}