forked from ScriptureEarth/ScriptureEarth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAllCountries.php
More file actions
22 lines (20 loc) · 797 Bytes
/
AllCountries.php
File metadata and controls
22 lines (20 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
/*
Created by Scott Starker
AJAX
*/
$st = $_GET["st"];
$SpecificCountry = $_GET['SpecificCountry'];
include './include/conn.inc.php';
$db = get_my_db();
include './translate/functions.php'; // translation function
$responseText = '';
$query="SELECT DISTINCT ISO_Country, $SpecificCountry FROM countries, ISO_countries WHERE countries.ISO_Country = ISO_countries.ISO_countries ORDER BY $SpecificCountry"; // create a prepared statement
$result=$db->query($query) or die (translate('Query failed:', $st, 'sys') . ' ' . $db->error . '</body></html>');
while ($row = $result->fetch_array()) {
$Country = trim($row[$SpecificCountry]);
$ISO_Country = $row['ISO_Country'];
$responseText .= $Country . '|' . $ISO_Country . '<br />';
}
echo $responseText;
?>