applications/dashboard/models/class.importmodel.php
public function Query($Sql, $Parameters = NULL) {
		$Db = Gdn::Database();

		// Replace db prefixes.
		$Sql = str_replace(array(':_z', ':_'), array($Db->DatabasePrefix.self::TABLE_PREFIX, $Db->DatabasePrefix), $Sql);

      // Figure out the type of the type of the query.
      if (StringBeginsWith($Sql, 'select'))
         $Type = 'select';
      elseif (StringBeginsWith($Sql, 'truncate'))
         $Type = 'truncate';
      elseif (StringBeginsWith($Sql, 'insert'))
         $Type = 'insert';
      elseif (StringBeginsWith($Sql, 'update'))
         $Type = 'update';
      elseif (StringBeginsWith($Sql, 'delete'))
         $Type = 'delete';
      else
         $Type = 'select';

		// Execute the query.
      if (is_array($Parameters))
         $this->SQL->NamedParameters($Parameters);

		$Result = $this->SQL->Query($Sql, $Type);

		//$this->Timer->Split('Sql: '. str_replace("\n", "\n     ", $Sql));

		return $Result;
	}
public function Query($Sql, $Parameters = NULL) {
		$Db = Gdn::Database();

		// Replace db prefixes.
		$Sql = str_replace(array(':_z', ':_'), array($Db->DatabasePrefix.self::TABLE_PREFIX, $Db->DatabasePrefix), $Sql);

      // Figure out the type of the type of the query.
      if (StringBeginsWith($Sql, 'select'))
         $Type = 'select';
      elseif (StringBeginsWith($Sql, 'truncate'))
         $Type = 'truncate';
      elseif (StringBeginsWith($Sql, 'insert'))
         $Type = 'insert';
      elseif (StringBeginsWith($Sql, 'update'))
         $Type = 'update';
      elseif (StringBeginsWith($Sql, 'delete'))
         $Type = 'delete';
      else
         $Type = 'select';

		// Execute the query.
      if (is_array($Parameters))
         $this->SQL->NamedParameters($Parameters);

		$Result = $this->SQL->Query($Sql, $Type);

		//$this->Timer->Split('Sql: '. str_replace("\n", "\n     ", $Sql));

		return $Result;
	}
public function Query ( $ Sql , $ Parameters = NULL ) { $ Db = Gdn :: Database ( ) ; // Replace db prefixes.
 $ Sql = str_replace ( array ( ':_z' , ':_' ) , array ( $ Db -> DatabasePrefix . self :: TABLE_PREFIX , $ Db -> DatabasePrefix ) , $ Sql ) ; // Figure out the type of the type of the query.
 if ( StringBeginsWith ( $ Sql , 'select' ) ) $ Type = 'select' ; elseif ( StringBeginsWith ( $ Sql , 'truncate' ) ) $ Type = 'truncate' ; elseif ( StringBeginsWith ( $ Sql , 'insert' ) ) $ Type = 'insert' ; elseif ( StringBeginsWith ( $ Sql , 'update' ) ) $ Type = 'update' ; elseif ( StringBeginsWith ( $ Sql , 'delete' ) ) $ Type = 'delete' ; else $ Type = 'select' ; // Execute the query.
 if ( is_array ( $ Parameters ) ) $ this -> SQL -> NamedParameters ( $ Parameters ) ; $ Result = $ this -> SQL -> Query ( $ Sql , $ Type ) ; //$this->Timer->Split('Sql: '. str_replace("\n", "\n     ", $Sql));
 return $ Result ; }
Run a query, replacing database prefixes.
@param string $Sql The sql to execute.
- :_z will be replaced by the import prefix.
- :_ will be replaced by the database prefix.
@param array $Parameters PDO parameters to pass to the query.
@return Gdn_DataSet
Run a query replacing database prefixes .