0
PHP 처리 스크립트에 AJAX 게시를하고 있습니다. MySQL이 등록을 진행하는 행을 반환하는지 확인하고 있습니다. 내가 가지고있는 문제는 - MySQL은 빠르게 1 행을 울리고 0을 울리고 0 행이 있더라도 등록을 진행합니다. 왜 1 행이 반환되고 신속하게 자체를 수정하는지 보는 이유는 무엇입니까?PHP MySQL_return_rows = echos 1 then 0
$.ajax({
type: "POST",
data: "username="+$(this).attr('username')+"password="+$(this).attr('email')+$(this).attr('password')+$(this).attr('passconf'),
url: "includes/register.php",
success: function(msg)
{
alert(data);
$("#result").data($data);
}
});
});
PHP 코드 :
$res = mysql_query("SELECT * FROM users WHERE username = '".$username."'");
if (!$res) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
$num = mysql_num_rows($res);
echo $num;
1을 빠르게 울리는 것은 무엇을 의미합니까? 이 스크립트에 여러 요청을 보냅니 까? – Headshota