有一句条件不会写。
$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 "<h2>没有查到数据哦,请正确输入用户名和密码。谢谢!</h2>";}
else {
//输出结果
}empty($numRows)&&$password <> substr(row[1].lenth-3,4) 我的意思是 ,当查询结果为空 或者 用户输入的密码和数据库中的row[1] 最后 4个字符对比,如果不对,就输出错误提示,让用户再次输入用户名和密码 .
运行时提示出错,Parse error: syntax error, unexpected '[' in D:\WWW\test.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 "<h2>没有查到数据哦,请正确输入用户名和密码。谢谢!</h2>";}
else {
//输出结果
}empty($numRows)&&$password <> substr(row[1].lenth-3,4) 我的意思是 ,当查询结果为空 或者 用户输入的密码和数据库中的row[1] 最后 4个字符对比,如果不对,就输出错误提示,让用户再次输入用户名和密码 .
运行时提示出错,Parse error: syntax error, unexpected '[' in D:\WWW\test.php
解决方案 »
- php system 函数调用 外部程序不成功,求救
- 新人请教
- PHP读UTF-8字符的问题
- PHP系统测试和debug工具 有什么?
- MySQL5.0.41版本,PHP页面提取中文数据显示问号?请高手帮忙
- Mysql,字段d是int类型,存的是timestamp,比较与当天的天数差,这个WHERE 条件该怎么写,并且这样设计是否效率会比较低?d字段索引是否
- PHP中数据导入EXCEL问题,大家来看看
- 怎样删除文件夹中含有部分字串的文件?
- 我用PHP查询SQLSERVER的数据,请问可不可以使用视图啊!
- 错在那?在线等待!!!!!急急急急急急急急
- 关于通过浏览器 调用socket后台超时问题
- 关于ThinkPHP模板图片路径
应写为
substr($nRow[3], -4)
$nRow=mssql_fetch_array($result);
if (empty($numRows) || $password <> substr(nRow[3],-4)) {echo "<h2>没有查到数据哦,请正确输入用户名和密码。谢谢!</h2>";}我已经改过来了