prepare($sql); $db_record->bindParam(':username',$username); $db_record->execute(); $setResuil=$db_record->fetch(PDO::FETCH_ASSOC); if($setResuil){ die("Username đã tồn tại trong hệ thống"); } $sql=$db_connect->prepare("INSERT INTO `user` (`username`,`password`,`name`,`dateOfBirth`,`class`,`email`,`sex`,`major`) VALUES (:username,:password,:name,:dateOfBirth,:class,:email,:sex,:major)"); $value=array('username'=>"$username",'password'=>"$password",'name' => "$name" ,'dateOfBirth' => "$dateOfBirth" , 'class'=> "$class" , 'email' => "$email" , 'sex' => "$sex" , 'major' => "$major"); $sql->execute($value); die("1"); } ?>