enanobot.php
changeset 4 8f62a406d9d9
parent 3 02e1c3f8f0ef
child 6 a802bb5b3e08
equal deleted inserted replaced
3:02e1c3f8f0ef 4:8f62a406d9d9
     1 <?php
     1 <?php
     2 // define('LIBIRC_DEBUG', '');
     2 define('LIBIRC_DEBUG', '');
     3 require('libirc.php');
     3 require('libirc.php');
     4 require('config.php');
     4 require('config.php');
     5 
     5 
     6 @ini_set('display_errors', 'on');
     6 @ini_set('display_errors', 'on');
     7 
     7 
     9 
     9 
    10 function mysql_reconnect()
    10 function mysql_reconnect()
    11 {
    11 {
    12   global $mysql_conn, $mysql_host, $mysql_user, $mysql_pass, $mysql_dbname;
    12   global $mysql_conn, $mysql_host, $mysql_user, $mysql_pass, $mysql_dbname;
    13   if ( $mysql_conn )
    13   if ( $mysql_conn )
       
    14   {
    14     @mysql_close($mysql_conn);
    15     @mysql_close($mysql_conn);
       
    16     if ( defined('LIBIRC_DEBUG') )
       
    17     {
       
    18       echo "< > Reconnecting to MySQL\n";
       
    19     }
       
    20   }
    15   // connect to MySQL
    21   // connect to MySQL
    16   $mysql_conn = @mysql_connect($mysql_host, $mysql_user, $mysql_pass);
    22   $mysql_conn = @mysql_connect($mysql_host, $mysql_user, $mysql_pass);
    17   if ( !$mysql_conn )
    23   if ( !$mysql_conn )
    18   {
    24   {
    19     $m_e = mysql_error();
    25     $m_e = mysql_error();