Programming Reference:Functions:CCBuildInsert

From CodeCharge Studio Community Wiki

Jump to: navigation, search

Description
Constructs the SQL necessary to do a database insert.

Location
Common

Syntax

CCBuildInsert(table, fields, connection);

Return value
String


Parameters

Name Type Description Required
table string The name of the table in which to insert. Yes
fields array An array holding the field names and their values. Yes
connection variable The name of the connection to use. Yes


See also:
CCBuildSQL, CCBuildUpdate


PHP

//A crude sample:

global $DBIntranetDB();
$db = new clsIntranetDB();
$db->InsertFields["Field1"]["Values"] = "inny";
$db->InsertFields["Field2"]["Values"] = "meeny";
$db->InsertFields["Field3"]["Values"] = "miny";
$db->InsertFields["Field4"]["Values"] = "moe";
$db->SQL = CCBuildInsert("MyTable", $db->InsertFields, $db);
$db->query($db->SQL);
Personal tools