mysql_connect('localhost', 'root', 'admin'); 
mysql_select_db('WineList'); 
$sql="SELECT DISTINCT WineCountry FROM Wines WHERE QtyInStock > 0 ORDER BY WineCountry"; 
$records = mysql_query($sql); 


$linecount=0;


$countries = array();

while($wine=mysql_fetch_assoc($records)){

    $linecount=$linecount+1;
    $countries[$linecount] = $wine['WineCountry'];

}

if($screentype=="large"){
echo "<table>;
 for ($x = 1; $x <= $linecount; $x++) {
    	echo "<tr><td><a href='http://192.168.104.254/wordpress/byCountry/?Listing=".$countries[$x]."'>".$countries[$x]."</a></td>";
    	echo "<td><a href='http://192.168.104.254/wordpress/byCountry/?Listing=".$countries[$x+1]."'>".$countries[$x+1]."</a></td></tr>";
        $x=$x+1;  	
}
echo "</table>";

