1
양식 검증에 문제가있는 경우 사용자 이름을 확인하는 경우를 제외하고는 모두 잘 작동하지만 사용자 이름이 테이블에 삽입되기 전후에 사용 가능한지 확인한 후 사용자 이름을 계속 가져옵니다. 이오류 확인 사용자 이름 확인 오류
Function get()
{
$error = array();
$sth = $this->db->prepare('SELECT * FROM user WHERE username = :user');
$sth->execute(array(':user' => $_POST['username']));
$count = $sth->rowCount();
If($count > 0)
{
$error['avaliable'] = 'The username is not avaliable';
}
If(!empty($error))
{
Return $error;
}else{
//insert codes goes here
}
}
명확하지 않지만 문제는 무엇입니까? 항상 사용자 이름을 사용할 수 없다고 말합니까? – Jentel