Added debug message for MySQL reconnection; it's tested and confirmed working now
authorDan
Wed, 07 May 2008 23:38:23 -0400
changeset 4 8f62a406d9d9
parent 3 02e1c3f8f0ef
child 5 fcc1eac04772
Added debug message for MySQL reconnection; it's tested and confirmed working now
enanobot.php
--- a/enanobot.php	Wed May 07 23:33:36 2008 -0400
+++ b/enanobot.php	Wed May 07 23:38:23 2008 -0400
@@ -1,5 +1,5 @@
 <?php
-// define('LIBIRC_DEBUG', '');
+define('LIBIRC_DEBUG', '');
 require('libirc.php');
 require('config.php');
 
@@ -11,7 +11,13 @@
 {
   global $mysql_conn, $mysql_host, $mysql_user, $mysql_pass, $mysql_dbname;
   if ( $mysql_conn )
+  {
     @mysql_close($mysql_conn);
+    if ( defined('LIBIRC_DEBUG') )
+    {
+      echo "< > Reconnecting to MySQL\n";
+    }
+  }
   // connect to MySQL
   $mysql_conn = @mysql_connect($mysql_host, $mysql_user, $mysql_pass);
   if ( !$mysql_conn )