//j'ajoute au début dans l'array
$elt_type['MOB'] = 4;
ensuite dans la requete qui sert à tout récup je fais
//on recupére tout ce qu'il y a sur le terrain dans le cadre à afficher===========
$qry1="select m1.x X,m1.y Y,m1.elt_type TYPE,t.id ID,t.image IMG,t.name NAME from map m1,terrain t where m1.elt_type='".$elt_type['GROUND']."' and m1.elt_id=t.id and m1.x between ".$x." and ".($x+$vis_x-1)." and m1.y between ".$y." and ".($y+$vis_y-1)." ";
$qry2="select m2.x X,m2.y Y,m2.elt_type TYPE,b.id ID,b.image IMG,b.name NAME from map m2,batiment b where m2.elt_type='".$elt_type['BUILD']."' and m2.elt_id=b.id and m2.x between ".$x." and ".($x+$vis_x-1)." and m2.y between ".$y." and ".($y+$vis_y-1)." ";
$qry3="select m3.x X,m3.y Y,m3.elt_type TYPE,p.id ID,p.image IMG,p.name NAME from map m3,perso p where m3.elt_type='".$elt_type['USER']."' and m3.elt_id=p.id and m3.x between ".$x." and ".($x+$vis_x-1)." and m3.y between ".$y." and ".($y+$vis_y-1)." ";
//ma requete mob
$qry4="select m4.x X,m4.y Y,m4.elt_type TYPE,m.id ID,m.image IMG,m.name NAME from map m4,mob m where m4.elt_type='".$elt_type['MOB']."' and m4.elt_id=m.id and m4.x between ".$x." and ".($x+$vis_x-1)." and m4.y between ".$y." and ".($y+$vis_y-1)." ";
//on utilise les UNION pour tout récupérer en 1 seule requête=================
$result=mysql_query($qry1." union ".$qry2." union ".$qry3." union ".$qry4);
//on stocke tout dans un tableau multidimension==============================
$map=array();