for($x=1; $x<50; $x++){ $mal = mysql_fetch_array(mysql_query("select * from tablo_adi where id='$id' and $x='$x'")); $adresim = $mal[''.$x.'']; echo $adresim; }