This is what I have done in my coding part. The code is free from errors but the values are not inserting
$name = $_POST['name'];
$cname = $_POST['cname'];
$caddr = $_POST['caddr'];
$password = $_POST['password'];
$cpassword = $_POST['cpassword'];
$target_path = "upload/";
$target_path = $target_path.basename($_FILES['photo']['name']);
move_uploaded_file($_FILES['photo']['tmp_name'], $target_path);
$str = "WEB";
$cnt = "SELECT COUNT(no) AS count FROM user";
$result = mysql_query($cnt);
$row = mysql_fetch_object($result);
$res = $row->count;
$res = $res+1;
$uid = $str.$res;
if($password==$cpassword) {
mysql_query("insert into user (no, uid, name, password, cpassword, photo) values('$res', '$uid', '$name', '$password', '$cpassword', '$target_path', now())");
}