library/database/class.sqldriver.php
public function Insert($Table = '', $Set = NULL, $Select = '') {
      if (count($Set) == 0 && count($this->_Sets) == 0) {
         return FALSE;
      }
      
      if (!is_null($Set) && $Select == '' && !array_key_exists(0, $Set)) {
         $this->Set($Set);
         $Set = $this->_Sets;
      }

      if ($Table == '') {
         if (!isset($this->_Froms[0]))
            return FALSE;

         $Table = $this->_Froms[0];
      }

      $Sql = $this->GetInsert($this->EscapeIdentifier($this->Database->DatabasePrefix.$Table), $Set, $Select);
      $Result = $this->Query($Sql, 'insert');
      
      return $Result;
   }
public function Insert($Table = '', $Set = NULL, $Select = '') {
      if (count($Set) == 0 && count($this->_Sets) == 0) {
         return FALSE;
      }
      
      if (!is_null($Set) && $Select == '' && !array_key_exists(0, $Set)) {
         $this->Set($Set);
         $Set = $this->_Sets;
      }

      if ($Table == '') {
         if (!isset($this->_Froms[0]))
            return FALSE;

         $Table = $this->_Froms[0];
      }

      $Sql = $this->GetInsert($this->EscapeIdentifier($this->Database->DatabasePrefix.$Table), $Set, $Select);
      $Result = $this->Query($Sql, 'insert');
      
      return $Result;
   }
public function Insert ( $ Table = '' , $ Set = NULL , $ Select = '' ) { if ( count ( $ Set ) == 0 && count ( $ this -> _Sets ) == 0 ) { return FALSE ; } if ( ! is_null ( $ Set ) && $ Select == '' && ! array_key_exists ( 0 , $ Set ) ) { $ this -> Set ( $ Set ) ; $ Set = $ this -> _Sets ; } if ( $ Table == '' ) { if ( ! isset ( $ this -> _Froms [ 0 ] ) ) return FALSE ; $ Table = $ this -> _Froms [ 0 ] ; } $ Sql = $ this -> GetInsert ( $ this -> EscapeIdentifier ( $ this -> Database -> DatabasePrefix . $ Table ) , $ Set , $ Select ) ; $ Result = $ this -> Query ( $ Sql , 'insert' ) ; return $ Result ; }
Builds the insert statement and runs the query, returning a result
object.

@param string $Table The table to which data should be inserted.
@param mixed  $Set An associative array (or object) of FieldName => Value pairs that should
be inserted, or an array of FieldName values that should have values
inserted from $Select.
@param string $Select A select query that will fill the FieldNames specified in $Set.
Builds the insert statement and runs the query returning a result object .