您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php文件中的sql的分割问题

2025/10/3 14:13:46发布10次查看
$query='select * from authorized_users where name= '.$userid.' and password=sha1('.$password.')';
这样写对吗?
回复讨论(解决方案) 字符串是用单引号括起来的
$query='select * from authorized_users where name= '.$userid.' and password=sha1('.$password.')';
这样写对吗?
$query=select * from authorized_users where name= '$userid' and password='{sha1($password)}';
$query='select * from authorized_users where name= '.$userid.' and password=sha1('.$password.')';
语法正确,但可读性不强
$query=select * from authorized_users where name='$userid' and password=sha1('$password');
这样是不是清爽些?
你们说的对的,我是初学,结果表名写错了。sorry!!!!
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product