DB::query PHP Method

query() public static method

public static query ( )
    public static function query()
    {
        $args = func_get_args();
        return call_user_func_array(array(DB::getMDB(), 'query'), $args);
    }

Usage Example

Example #1
1
 public function testInstall()
 {
     global $DB;
     $query = "SHOW FULL TABLES WHERE TABLE_TYPE LIKE 'VIEW'";
     $result = $DB->query($query);
     while ($data = $DB->fetch_array($result)) {
         $DB->query("DROP VIEW " . $data[0]);
     }
     $query = "SHOW TABLES";
     $result = $DB->query($query);
     while ($data = $DB->fetch_array($result)) {
         $DB->query("DROP TABLE " . $data[0]);
     }
     include_once GLPI_ROOT . "/inc/dbmysql.class.php";
     include_once GLPI_CONFIG_DIR . "/config_db.php";
     // Install a fresh 0.80.5 DB
     $DB = new DB();
     $res = $DB->runFile(GLPI_ROOT . "/install/mysql/glpi-0.80.3-empty.sql");
     $this->assertTrue($res, "Fail: SQL Error during install");
     // update default language
     $query = "UPDATE `glpi_configs`\n                SET `language` = 'en_GB'";
     $this->assertTrue($DB->query($query), "Fail: can't set default language");
     $query = "UPDATE `glpi_users`\n                SET `language` = 'en_GB'";
     $this->assertTrue($DB->query($query), "Fail: can't set users language");
     $GLPIlog = new GLPIlogs();
     $GLPIlog->testSQLlogs();
     $GLPIlog->testPHPlogs();
 }
All Usage Examples Of DB::query