利用语句拆开来写:
(下述的代码通过验证可用)
$lguid=trim($lguid);
$lgpsd=trim($lgpsd);
$lgpsd=md5($lgpsd);
$qu="select userid,password from customer where userid='$lguid' and password='$lgpsd'";
$res=@mysql_query($qu,$link);
(下述的代码通过验证可用)
$lguid=trim($lguid);
$lgpsd=trim($lgpsd);
$lgpsd=md5($lgpsd);
$qu="select userid,password from customer where userid='$lguid' and password='$lgpsd'";
$res=@mysql_query($qu,$link);
mysql> create table if not exists tests(users varchar(10) binary not null,passwd
varchar(50) binary not null);
Query OK, 0 rows affected (0.04 sec)mysql> insert into tests values ('webmin',md5('12345'));
Query OK, 1 row affected (0.01 sec)mysql> select * from tests;
+--------+----------------------------------+
| users | passwd |
+--------+----------------------------------+
| webmin | 827ccb0eea8a706c4c34a16891f84e7b |
+--------+----------------------------------+
1 row in set (0.00 sec)mysql> select * from tests where passwd = md5('12345');
+--------+----------------------------------+
| users | passwd |
+--------+----------------------------------+
| webmin | 827ccb0eea8a706c4c34a16891f84e7b |
+--------+----------------------------------+
1 row in set (0.00 sec)
还是在windows下执行的mysql?
我在windows下执行没问题,
但是在linux下执行失败