1. How can I stop the function if MySQL could'nt connect to database?

    Code:
    _mySqlConnection = _mySql.OpenDb("ip", 3306, "etc", "etc", "ip", this);
    // Lets say mysql host is down, how can I stop the function from going to code?//CODE
    
     
  2. have you tried, try/catch?


    Code:
    try {
         _mySqlConnection = _mySql.OpenDb("ip", 3306, "etc", "etc", "ip", this);
    }
    catch (Exception e)
    {
         Puts(e);
    }
    
    This could allow you to keep trying to connect on failure as well
     
  3. The MySQL extension catches exceptions currently.
    _mySqlConnection might be null as a result of that, and in either case, once you run a query against the DB, the result set will be null as well if it can't query the DB.
    Otherwise, @Calytic might be able to provide more insight :p