classes/database.php
/**
	 * Builds an INSERT statement using the values provided
	 *
	 * @param string $table the table name
	 * @param array $data the column => value pairs
	 * @return int
	 */
Builds an INSERT statement using the values provided
@param string $table the table name
@param array $data the column => value pairs
@return int
Builds an INSERT statement using the values provided @param string $table the table name @param array $data the column = > value pairs @return int
public function insert($table, array $data = array())
	{
		$sql = 'INSERT INTO "'. $table .'" ("'. implode('", "', array_keys($data)). '") ';
		$sql .= ' VALUES ('. rtrim(str_repeat('?,', count($data)), ','). ')';
		$this->query($sql, array_values($data));
		return $this->connection->lastInsertId();
	}
public function insert ( $ table , array $ data = array ( ) ) { $ sql = 'INSERT INTO "' . $ table . '" ("' . implode ( '", "' , array_keys ( $ data ) ) . '") ' ; $ sql .= ' VALUES (' . rtrim ( str_repeat ( '?,' , count ( $ data ) ) , ',' ) . ')' ; $ this -> query ( $ sql , array_values ( $ data ) ) ; return $ this -> connection -> lastInsertId ( ) ; }
Builds an INSERT statement using the values provided
 @param string $table the table name
 @param array $data the column => value pairs
 @return int
Builds an INSERT statement using the values provided @param string $table the table name @param array $data the column = > value pairs @return int
// Start the insert query // Add the value placeholders // Run the query // Return the new row's Id