cvs: php-master-web /fetch countries.php
| From: | jim winstead | Date: | Sun, 03 Mar 2002 18:51:04 +0000 |
| Subject: | cvs: php-master-web /fetch countries.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-8924@lists.php.net to get a copy of this message | ||
jimw Sun Mar 3 13:51:04 2002 EDT
Added files:
/php-master-web/fetch countries.php
Log:
generate php code for list of countries
Index: php-master-web/fetch/countries.php
+++ php-master-web/fetch/countries.php
<?php
# token required, since this should only get accessed from rsync.php.net
if (!isset($token) || md5($token) != "19a3ec370affe2d899755f005e5cd90e")
die("token not correct.");
// Connect and generate the list from the DB
if (@mysql_connect("localhost","nobody","")) {
if (@mysql_select_db("php3")) {
$res = @mysql_query("SELECT * FROM country ORDER BY name");
if ($res) {
echo "<?php\n\$COUNTRIES = array(\n";
while ($row = @mysql_fetch_array($res)) {
echo "'$row[id]' => '$row[name]',\n";
}
echo ");\n";
echo "?>\n";
}
}
}