Not sure which library you use, PDO or Mysqli or any other
Wrong syntax
First of all, your code will not work, as it will generate not a proper query
Hint: if unsure, echo your query first to check what it generates
SELECT clearanceid,regno,names,progcode,status,pfno,reasons FROM clearance WHERE regno= '.123.'
What will generate proper query is:
<?php
$sql = "SELECT clearanceid,regno,names,progcode,status,pfno,reasons
FROM clearance
WHERE regno= '{$regno}'";
You miss seciurity
If regno is numeric:
<?php
$regno = intval($_SESSION['regno']); // or floatval
$sql = "SELECT clearanceid,regno,names,progcode,status,pfno,reasons FROM clearance WHERE regno= {$regno}";
Edit: If $regno is a string, then use prepared statements as Dharman suggested