时间:2021-07-01 10:21:17 帮助过:13人阅读
//connection to the database$dbhandle = mssql_connect($myServer, $myUser, $myPass) or die("连接不上数据库"); //select a database to work with$selected = mssql_select_db($myDB, $dbhandle) or die("连接不上指定数据库"); $username=trim($_POST['username']);$password=trim($_POST['pass']);//declare the SQL statement that will query the database$query = "select top 6 * from WEB_VIEW where DNBH='$username' order by SFMonth desc ";//execute the SQL query and return records$result = mssql_query($query) or die ("查询数据失败: ".mysql_error());$numRows = mssql_num_rows($result); $nRow=mssql_fetch_array($result);if ($password <> substr($nRow[3],-4)) {echo "输入有误,请正确输入用户名和密码。谢谢!
";}else { if (empty($numRows)) echo "没有查到数据哦,请正确输入用户名和密码。谢谢!
"; else { //$nRow=mssql_fetch_array($result); echo "你好!电脑编号为"; echo "$username"; echo ","; echo "户名"; echo "$nRow[2]"; echo "