[PHP-DB] MySQL/PHP how to put the results of one query in another query

2005-06-26 Thread Pedro Quaresma de Almeida
Hi I have two MySQL databases, on for aeromodelistas (aeromodelling) and another for Códigos Postais (Postal Codes). I whant to do the following query SELECT CódigoPostal FROM Aeromodelistas WHERE CódigoPostal IN (SELECT distinct(CP4) FROM codigopostal.LOCART,codigopostal.DISTRITO WHERE

Re: [PHP-DB] MySQL/PHP how to put the results of one query in another query

2005-06-26 Thread Ross Honniball
This is what I use when needing to do this: 1. Put all the values you want to search for in an array $vals (loop around the first result) 2. $query = select count(Nome) from Aeromodelistas where year(AnoQuota)=2005 and Sexo='Masculino' and Distrito IN .sqlIn($vals) ; function