mysql_select_db('studentsystem') or die("无法选择数据库,请重试")
$set="select * from manager where username='".$_POST['username']."'
and password='".$_POST['pass']."'"
$Result = mysql_query($set)// 结果集
$rows= mysql_fetch_array($Result,MYSQL_ASSOC) //读取数据
////重点在这里
if($rows){
echo "成功"
}else {
echo '不成功'
}
mysql_free_result($Result)
$conn = mysql_connect("localhost","root","")mysql_select_db("homework", $conn)
mysql_query("SET NAMES 'UTF8'",$conn)
$username=$_POST['user_email']
$password=$_POST['password']
$sql = "select * from user where username='$username' and password='$password'"
$Result = mysql_query($sql, $conn)
$onerow = mysql_fetch_array($Result)
if ( $onerow )
echo "正确"
else
echo "错误"
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)