Gdn_SQLDriver::truncate PHP Method

truncate() public method

Truncates all data from a table (will delete from the table if database does not support truncate).
public truncate ( string $Table = '' )
$Table string The table to truncate.
    public function truncate($Table = '')
    {
        if ($Table == '') {
            if (!isset($this->_Froms[0])) {
                return false;
            }
            $Table = $this->_Froms[0];
        } else {
            $Table = $this->escapeIdentifier($this->Database->DatabasePrefix . $Table);
        }
        $Sql = $this->getTruncate($Table);
        $Result = $this->query($Sql, 'truncate');
        return $Result;
    }