$sql = "select * from tbl_pi where patientNumber='" . $pn . "'";
$res = mysql_query($sql);
if (mysql_num_rows($res) == 1) {
    echo '<center>
            <p style="background-color: #ff3333;
               font-family:calibri;
               color:white;
               font-weight: bold;">PATIENT NUMBER ALREADY IN USE!!</p>';
}
after the error detection, the user have no choice but to start over since the previous data entered were all gone or reset.
How can I prevent that from happening?
 
    