Drupal 寻呼机无法与“LIKE”一起使用在查询中
当使用带有 LIKE
的查询时,我无法让它工作。示例:
$sql = " SELECT DISTINCT u.uid, u.name, u.status, u.created, u.access FROM d_bi_test_2_shared.users u LEFT JOIN d_bi_test_2.users_roles ur ON u.uid = ur.uid WHERE u.uid != 0 AND LOWER(u.name) LIKE LOWER('%%er%%') ";
$sqlCount = " SELECT COUNT(*) FROM d_bi_test_2_shared.users u LEFT JOIN d_bi_test_2.users_roles ur ON u.uid = ur.uid WHERE u.uid != 0 AND LOWER(u.name) LIKE LOWER('%%er%%') ";
$count = 3;
$query = pager_query($sql, 5, 0, $sqlCount);
$output.=theme('pager', $count);
这根本没有给我寻呼机。如果我取出 LIKE
它可以工作,但我需要像这样搜索我的表单。
I can't get this to work when using a query with LIKE
. Example:
$sql = " SELECT DISTINCT u.uid, u.name, u.status, u.created, u.access FROM d_bi_test_2_shared.users u LEFT JOIN d_bi_test_2.users_roles ur ON u.uid = ur.uid WHERE u.uid != 0 AND LOWER(u.name) LIKE LOWER('%%er%%') ";
$sqlCount = " SELECT COUNT(*) FROM d_bi_test_2_shared.users u LEFT JOIN d_bi_test_2.users_roles ur ON u.uid = ur.uid WHERE u.uid != 0 AND LOWER(u.name) LIKE LOWER('%%er%%') ";
$count = 3;
$query = pager_query($sql, 5, 0, $sqlCount);
$output.=theme('pager', $count);
This gives me no pager at all. If I take out the LIKE
it works, but I need to search like that for my form.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试 CONCAT('%%',LOWER(er),'%%')
try CONCAT('%%',LOWER(er),'%%')