alecpl
2010-04-01 70318e5463986edff014e881e7e121483679726b
program/include/rcube_mdb2.php
@@ -46,6 +46,8 @@
  var $a_query_results = array('dummy');
  var $last_res_id = 0;
  private $tables;
  /**
@@ -267,7 +269,7 @@
        $this->db_error_msg = $q->userinfo;
        raise_error(array('code' => 500, 'type' => 'db',
     'line' => __LINE__, 'file' => __FILE__,
          'line' => __LINE__, 'file' => __FILE__,
          'message' => $this->db_error_msg), TRUE, TRUE);
        }
      else
@@ -394,6 +396,26 @@
  /**
   * Wrapper for the SHOW TABLES command
   *
   * @return array List of all tables of the current database
   */
  function list_tables()
  {
    // get tables if not cached
    if (!$this->tables) {
      $this->db_handle->loadModule('Manager');
      if (!PEAR::isError($result = $this->db_handle->listTables()))
        $this->tables = $result;
      else
        $this->tables = array();
    }
    return $this->tables;
  }
  /**
   * Formats input so it can be safely used in a query
   *
   * @param  mixed   Value to quote