 <pre><code>$result = mysql_query("SELECT * FROM stores where StoreID=$id order by city"); if (!$result) { die('Invalid query: ' . mysql_error()); }else{ while($row = mysql_fetch_assoc($result)){ echo $row['city']." : ".$row['street']."&lt;br /&gt;"; } } </code></pre> <p>while() is fetching results step by step, so it will give it your result</p>