Collection | Country of Origin

[insert_php]
$dbcnx = @mysql_connect(“205.178.146.73″,”artifacts”,”Artifacts123″);
if (!$dbcnx) {
echo( “

Unable to connect to the database server at this time.

” );
exit();
};
if (!@mysql_select_db(“artifacts”, $dbcnx) ) {
echo( “

Unable to locate the artifacts database at this time.

“);
exit();
};
$countfullq = mysql_query(“SELECT DISTINCT accno2, COUNT(DISTINCT accno2) AS countrycount FROM artifacts”);
$countfull = mysql_fetch_array($countfullq);
$countdiv = ($countfull[‘countrycount’] / 3);
$countup = ceil($countdiv);
$left = mysql_query(“SELECT DISTINCT country, accno2 FROM artifacts ORDER BY `artifacts`.`country` ASC LIMIT 0 , ” . $countup . “”);
$middle = mysql_query(“SELECT DISTINCT country, accno2 FROM artifacts ORDER BY `artifacts`.`country` ASC LIMIT ” . $countup . ” , ” . $countup . “”);
$right = mysql_query(“SELECT DISTINCT country, accno2 FROM artifacts ORDER BY `artifacts`.`country` ASC LIMIT ” . 2 * $countup . ” , ” . $countup . “”);
[/insert_php]

[insert_php]
while($ctry1 = mysql_fetch_array($left)) {
$count1 = mysql_query(“SELECT COUNT(accno3) FROM artifacts WHERE accno2 = ‘” . $ctry1[‘accno2’] . “‘”);
$count2 = mysql_fetch_array($count1);
echo(“

“);
}
[/insert_php]

[insert_php]
while($ctry2 = mysql_fetch_array($middle)) {
$count1 = mysql_query(“SELECT COUNT(accno3) FROM artifacts WHERE accno2 = ‘” . $ctry2[‘accno2’] . “‘”);
$count2 = mysql_fetch_array($count1);
echo(“

“);
}
[/insert_php]

[insert_php]
while($ctry3 = mysql_fetch_array($right)) {
$count1 = mysql_query(“SELECT COUNT(accno3) FROM artifacts WHERE accno2 = ‘” . $ctry3[‘accno2’] . “‘”);
$count2 = mysql_fetch_array($count1);
echo(“

“);
}
[/insert_php]