[Klug-general] Mysql subqueries in PHP

Daniel Subert zm at zone12.co.uk
Wed Jun 29 09:18:20 UTC 2011


Have you tested the subquery in php?



On 29 Jun 2011, at 09:13, Dan Attwood <danattwood at gmail.com> wrote:

> 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
>  
> _______________________________________________
> Kent mailing list
> Kent at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/kent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/kent/attachments/20110629/110126c8/attachment.htm>


More information about the Kent mailing list