您好,我需要使用区分大小写的用户名登录..
我尝试在终端中使用 mysql 使用我的 zf2 模型生成的查询,并且工作正常,但在我的 zf2 中它不能很好地工作。
我的mysql代码:
SELECT *
FROM user
LEFT JOIN role AS role
ON role.id = user.role
LEFT JOIN info AS i
ON i.userId = user.id
WHERE BINARY user.username = 'username'
AND user.password = 'password';
我的 zf2 代码:
$select = new \Zend\Db\Sql\Select;
$select->from('user')
->columns(array('primary'=>'id','username','password','salt','role','acti
最佳答案
我可以通过将表的列更改为区分大小写( ..._cs )排序规则来解决此问题
关于php - 使用 BINARY 查询 ZF2 模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27352639/