First of all please excuse my vocabulary, english isn't my mother tong.
I'm having a hard time trying to do this.
I have two tables in a MySQL db, first one is for members datas, second one if the one for french departments (geography).
I need to have a list of every department followed by the list of members that are living in this department (after it will be parsed to a Flash animation in a dynamic text box).
Here is my code:
Expand|Select|Wrap|Line Numbers
- <?php
- //getting every department, sorted by name
- $variables="SELECT * FROM membres_regions ORDER BY 'Var_flash'";
- $resultat=mysql_query ($variables);
- //as long as we have a department
- while( $var=mysql_fetch_array ($resultat) ){
- //getting the variables
- $flashvar=$var['Var_flash'];
- $region=$var['Region'];
- //shows each department
- echo "$flashvar=";
- //get breeders, sorted by pas Affixe
- $query_eleveurs = "SELECT * FROM membres_aacas WHERE Region='$region' AND Publication='Oui' ORDER BY Affixe";
- $result_eleveurs = mysql_query($query_eleveurs);
- while( $eleveurs = mysql_fetch_array($result_eleveurs) ){
- $popup=$eleveurs['popup'];
- $affixe=$eleveurs['Affixe'];
- $race=$eleveurs['Race'];
- $chaton=$eleveurs['chatons'];
- echo "<a href=\"asfunction:popup,../chatteries/$popup\"><b>$affixe</b></a><br>$race - $chaton<br>";
- }
- }
- mysql_close();
- ?>
&ain=breeder xx breed ii
&aisne=
&allier=
&alpesdehauteprovence=
&alpesmaritimes=breeder yy breed jj
And I would like to have :
&ain=breeder xx breed ii
&aisne=No breeder !
&allier=No breeder !
&alpesdehauteprovence=No breeder !
&alpesmaritimes=breeder yy breed jj
I know that my second querry is an obstacle to obtain this result because it shows only "true" results : "WHERE Region='$region' "
But I cant figure out how to get what I need...
If someone here could help, this would be wonderfull... I really am a beginner so please, be patient !
Thank you very much.