$sql_check = "Select * from $tbl_name where username = '$myusername'";
// Check Username in table
$result_check=mysql_query($sql_check);
$count=mysql_num_rows($result_check);
if($count==0){ // no this username in table
// insert
$sql="INSERT INTO $tbl_name(username, password)VALUES('$myusername', '$mypassword_enc')";
}else{ // There is this username in table
?>
<script language="javascript">
alert("Cannot use this Username !");
</script>
<?
header ("Refresh: 1; URL = register.php") ;
};