cvs: phpweb /include shared-manual.inc
| From: | Jim Winstead | Date: | Tue, 20 Mar 2001 20:03:28 +0000 |
| Subject: | cvs: phpweb /include shared-manual.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-4526@lists.php.net to get a copy of this message | ||
jimw Tue Mar 20 12:03:28 2001 EDT
Modified files:
/phpweb/include shared-manual.inc
Log:
handle database failures more gracefully
Index: phpweb/include/shared-manual.inc
diff -u phpweb/include/shared-manual.inc:1.95 phpweb/include/shared-manual.inc:1.96
--- phpweb/include/shared-manual.inc:1.95 Mon Mar 12 10:43:32 2001
+++ phpweb/include/shared-manual.inc Tue Mar 20 12:03:28 2001
@@ -175,9 +175,9 @@
# $host = '127.0.0.1';
$user = 'nobody';
$pass = '';
- $db_id = mysql_connect($host, $user, $pass);
+ $db_id = @mysql_connect($host, $user, $pass);
$query = "SELECT *,UNIX_TIMESTAMP(ts) AS xwhen FROM note WHERE sect = '$title' OR
sect = '$id' ORDER BY id";
- $result_id = mysql_db_query("php3", $query, $db_id);
+ if ($db_id) $result_id = mysql_db_query("php3", $query, $db_id);
if ($result_id && mysql_num_rows($result_id) > 0) {
while ($row = mysql_fetch_array($result_id)) {
$notes[] = $row;
@@ -225,9 +225,9 @@
$host = 'localhost';
$user = 'nobody';
$pass = '';
- $db_id = mysql_connect($host, $user, $pass);
+ $db_id = @mysql_connect($host, $user, $pass);
$query = "SELECT UNIX_TIMESTAMP(ts) AS stamp FROM note WHERE sect = '$title'
OR sect = '$id' ORDER BY ts DESC limit 1";
- $result_id = mysql_db_query("php3", $query, $db_id);
+ if ($db_id) $result_id = @mysql_db_query("php3", $query, $db_id);
} else {
$result_id = 0;
}