$photoquery=mysql_query("Select photo from members where photo!=''"); while($line=mysql_fetch_array($photoquery)){ $fruits[] = $line['photo']; } print_r ($fruits);