'.ucwords($topic).'';
$html .= '
' . $q . "
";
$region = convToFile($q);
$countryCode = strtolower($countryCode);
//
// First try to connect to the temporary database
//
$db = sqlite_open('../db/'.$tempdb.'.sqlite', 0666, $error);
if (!$db) {
$renderer->doc .= ' The database error is '. $error .'
';
return FALSE;
}
$query = "SELECT * FROM states WHERE state_abbr = '".$q."'";
$result = sqlite_query($db, $query);
if (!$result) {
$renderer->doc .= ' Cannot execute query.
';
return FALSE;
}
$row = sqlite_fetch_array($result, SQLITE_ASSOC);
sqlite_close($db);
$state = $row['state'];
$id = $row['state_id'];
$countryCode = strtolower($countryCode);
$namespace = $topic;
$path = $topic . ':earth:' . $continent . ':' . $countryCode . ':' . $region;
$wikiData = pullInWikiData($path, $namespace, $topic);
if ($wikiData != '')
$html .= $wikiData;
else
$html .= ''. htmlentities($exploreErrors['editPg']['en'], ENT_NOQUOTES) . htmlentities($exploreErrors['ckBack']['en'], ENT_NOQUOTES) .'
';
$html .= '
';
$html .= htmlentities($exploreErrors['update']['en'], ENT_NOQUOTES);
echo $html;
?>