cvs: php-hosts-web /include shared.inc
| From: | jim winstead | Date: | Sun, 21 Apr 2002 22:12:36 +0000 |
| Subject: | cvs: php-hosts-web /include shared.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-9726@lists.php.net to get a copy of this message | ||
jimw Sun Apr 21 18:12:36 2002 EDT
Modified files:
/php-hosts-web/include shared.inc
Log:
get colin off the hook, don't always calculate total number of hosts, and add mysql_get_one
helper function
Index: php-hosts-web/include/shared.inc
diff -u php-hosts-web/include/shared.inc:1.2 php-hosts-web/include/shared.inc:1.3
--- php-hosts-web/include/shared.inc:1.2 Sat Apr 20 18:00:07 2002
+++ php-hosts-web/include/shared.inc Sun Apr 21 18:12:36 2002
@@ -1,7 +1,7 @@
<?
srand(date("s"));
-$SYSOP = "colin@easydns.com";
+$SYSOP = "webmaster@php.net";
$ROOT_URL = "http://hosts.php.net";
$ROOT_DIR = $DOCUMENT_ROOT;
@@ -23,15 +23,17 @@
$OPTIONS_TABLE = "options";
$MSGS_TABLE = "msgboard_msgs";
-$query = "select count(*) as count from $HOSTS_TABLE";
-$q1 = mysql_db_query($DBASE,$query) or die ("Database not working ... email <A
HREF=\"mailto:$SYSOP\">sysop</A>.");
-$NUM_HOSTS = mysql_result($q1,0,"count");
-mysql_free_result($q1);
-
-
$BOOLEAN[0] = "No";
$BOOLEAN[1] = "Yes";
+
+function mysql_get_one($query) {
+ $res = mysql_query($query);
+ if (!$res) {
+ return false;
+ }
+ return mysql_result($res,0);
+}
function qecho($stuff) {
echo HTMLSpecialChars($stuff);