<?php
$db = mysqli_connect("localhost","root","","hell");
mysql_connect("localhost", "root", "");
mysql_select_db("accounts");
$codenm = mysql_escape_string(($_POST['codenm']));
$check = mysql_query ("SELECT codenm FROM users WHERE codenm='$codenm'");
$check_num_rows = mysql_num_rows($check);
if ($codenm == NULL)
echo "Choose a Codename";
else if (strlen($codenm)<4)
echo "Too Short";
else
{
if ($check_num_rows == 0)
{
echo "Available!";
}else{
if ($check_num_rows == 1)
echo "Not Available";
}
}
?>
我已尝试isset
,但当我在页面时echo
只停留在
“太短”
当我使用isset
但如果我没用过一个
我显示错误
注意:未定义的索引:第6行的codenm
当我输入codenm
字段时,错误消失但回声不起作用