Heim >Backend-Entwicklung >PHP-Tutorial >php判断语句
有一句条件不会写。
$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 (empty($numRows)&&$password substr(row[3], -4) ) {echo "
substr(row[3], -4)
应写为
substr($nRow[3], -4)
$numRows = mssql_num_rows($result);
$nRow=mssql_fetch_array($result);
if (empty($numRows) || $password substr(nRow[3],-4)) {echo "
你怎么总是要漏掉“$”