public function insertObjects($table, $list) {
		
		if (!is_array($list) or 0==count($list)) {
			return 0;
		}
		
		$records = array();
		$fields  = array();
		
		foreach ($list as $object) {

			$values = array();
		
			foreach (get_object_vars($object) as $k => $v) {
				
				if (!count($records))	{
					$fields[] = '`' . $k . '`';
				}
				
				$values[] = is_null($v) ? 'NULL' : $this->quote($v);

			}

			$records[] = '('. implode(',', $values) .')';
			
		}
		
		$sql = 'INSERT INTO `'. $table .'` (%s) VALUES %s';

		$this->query = sprintf($sql, implode(',', $fields), implode(',', $records));

		$res = $this->exec($this->query);

		return $res;
		
	}
public function insertObjects($table, $list) {
		
		if (!is_array($list) or 0==count($list)) {
			return 0;
		}
		
		$records = array();
		$fields  = array();
		
		foreach ($list as $object) {

			$values = array();
		
			foreach (get_object_vars($object) as $k => $v) {
				
				if (!count($records))	{
					$fields[] = '`' . $k . '`';
				}
				
				$values[] = is_null($v) ? 'NULL' : $this->quote($v);

			}

			$records[] = '('. implode(',', $values) .')';
			
		}
		
		$sql = 'INSERT INTO `'. $table .'` (%s) VALUES %s';

		$this->query = sprintf($sql, implode(',', $fields), implode(',', $records));

		$res = $this->exec($this->query);

		return $res;
		
	}
public function insertObjects ( $ table , $ list ) { if ( ! is_array ( $ list ) or 0 == count ( $ list ) ) { return 0 ; } $ records = array ( ) ; $ fields = array ( ) ; foreach ( $ list as $ object ) { $ values = array ( ) ; foreach ( get_object_vars ( $ object ) as $ k => $ v ) { if ( ! count ( $ records ) ) { $ fields [ ] = '`' . $ k . '`' ; } $ values [ ] = is_null ( $ v ) ? 'NULL' : $ this -> quote ( $ v ) ; } $ records [ ] = '(' . implode ( ',' , $ values ) . ')' ; } $ sql = 'INSERT INTO `' . $ table . '` (%s) VALUES %s' ; $ this -> query = sprintf ( $ sql , implode ( ',' , $ fields ) , implode ( ',' , $ records ) ) ; $ res = $ this -> exec ( $ this -> query ) ; return $ res ; }
Insert more than one row into param table.

@param	string	Table name.
@param	array	Object list, named as the table fields.

@return	integer	Number of inserted rows.
Insert more than one row into param table .