public function insertObject($table, $object) {

		$fields = array();
		$values = array();

		// converts all object properties in vars SQL ready
		foreach (get_object_vars($object) as $k => $v) {
			if (is_string($v) or is_numeric($v)) {
				$fields[] = '`' . $k . '`';
				$values[] = $this->quote($v);
			} else if (is_null($v)) {
				$fields[] = '`' . $k . '`';
				$values[] = 'NULL';
			}
		}

		$sql = 'INSERT INTO `'. $table .'` (%s) VALUES (%s)';
		$this->query = sprintf($sql, implode(', ', $fields), implode(', ', $values));
		
		$res = $this->exec($this->query);
		
		return (bool)$res;
		
	}
public function insertObject($table, $object) {

		$fields = array();
		$values = array();

		// converts all object properties in vars SQL ready
		foreach (get_object_vars($object) as $k => $v) {
			if (is_string($v) or is_numeric($v)) {
				$fields[] = '`' . $k . '`';
				$values[] = $this->quote($v);
			} else if (is_null($v)) {
				$fields[] = '`' . $k . '`';
				$values[] = 'NULL';
			}
		}

		$sql = 'INSERT INTO `'. $table .'` (%s) VALUES (%s)';
		$this->query = sprintf($sql, implode(', ', $fields), implode(', ', $values));
		
		$res = $this->exec($this->query);
		
		return (bool)$res;
		
	}
public function insertObject ( $ table , $ object ) { $ fields = array ( ) ; $ values = array ( ) ; // converts all object properties in vars SQL ready
 foreach ( get_object_vars ( $ object ) as $ k => $ v ) { if ( is_string ( $ v ) or is_numeric ( $ v ) ) { $ fields [ ] = '`' . $ k . '`' ; $ values [ ] = $ this -> quote ( $ v ) ; } else if ( is_null ( $ v ) ) { $ fields [ ] = '`' . $ k . '`' ; $ values [ ] = 'NULL' ; } } $ sql = 'INSERT INTO `' . $ table . '` (%s) VALUES (%s)' ; $ this -> query = sprintf ( $ sql , implode ( ', ' , $ fields ) , implode ( ', ' , $ values ) ) ; $ res = $ this -> exec ( $ this -> query ) ; return ( bool ) $ res ; }
Inserts a new row in param table with all properties value as fields value.

@param	string	Table name.
@param	object	Object with property name as each field name.

@return	bool	TRUE if insert was succesfully done.
Inserts a new row in param table with all properties value as fields value .