JOIN和Wild Card运算符与php无法正常工作

时间:2015-06-18 14:30:03

标签: php mysql

我有以下查询在PHPMyAdmin中完美运行,但在与PHP一起使用时会产生不准确的结果:

SELECT u.id,u.firstname AS specfn, u.lastname AS
   specln,u2.firstname,u2.lastname,r.entertainer_id
FROM users u 
INNER JOIN relationship r ON u.id=r.spectator_id 
INNER JOIN users u2 ON r.entertainer_id=u2.id
WHERE (u2.lastname like '%e%' OR u2.firstname like '%e%') AND u.id=1

为什么这不能用PHP工作?

0 个答案:

没有答案