<?php
(...)
require("sql.php3.inc");
Header("Content-type: text/plain");
function mkCond($s) {
$s = " metal=\"".$s."\"";
}
$metal = array("ag","au","ba","ca","cd","co",
"cr","cu","fe","gd","hg","k","mg",
"mn","mo","na","ni","pb","pt","v",
"w","zn","sr");
array_walk($metal,"mkCond");
$condition = implode($metal," OR ");
if ($showmetal=="y") {
$fields = "source_id,metal";
} else {
$fields = "source_id";
}
$qstring = "select distinct $fields from site where ";
$qstring .= $condition." order by source_id";
$link = SQL_pconnect();
(...)
?>