[Klug-general] Mysql subqueries in PHP
Dan Attwood
danattwood at gmail.com
Wed Jun 29 08:27:01 UTC 2011
I know that isn't strictly Linux but here we go;
I have the following mysql query:
SELECT * FROM usr WHERE usr.id NOT IN (SELECT DISTINCT member FROM
mahara.group_member WHERE mahara.group_member.group='10')
This selects all users in the usr table that don't have entry for group 10
in the group_member table
The query works as expected when run in mysql workbench
However when I run it in a php script it only run the first part, so does a
select * from usr
Has anyone come across this before and have any idea of a fix?
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/kent/attachments/20110629/d3a0398b/attachment.htm>
More information about the Kent
mailing list