WIKINDX METHODS

Method:
insert()

Class:
SQL

Method Call:
include_once("core/sql/SQL.php");
$db = new SQL();
$db->insert(STRING: $table, ARRAY: $fields, ARRAY: $values, [STRING: $condition]);

Description:
Execute an INSERT statement.

Do not add backticks, single-quotes or any other methods of escaping a string -- the SQL class will do this automatically depending on the database we're connected to as long as $fields and $values are arrays. If it fails to execute the query, the script will exit with an error message.

Usage:
For example (assuming the database object exists within a class as $this->db):

	$table = "WKX_resource";
	$fields = array("title", "subtitle");
	$values = array("WIKINDX", "A Guide for the Helpless");
	$this->db->insert($table, $fields, $values);

WIKINDX home      WIKINDX usage      WIKINDX classes