/ LJCPHPCodeDoc / LJCDataManagerLib / LJCSQLBuilder / CreateInsert


Parameters
$tableName - The table name.
$dataColumns - The Data columns.

Returns

The Update SQL statement.

Syntax

PHP
public static function CreateInsert(string $tableName
, LJCDbColumns $dataColumns) : string

Creates an Insert SQL statement.

Example

PHP
 $webCommonPath = "c:/inetpub/wwwroot/LJCPHPCommon";
 require_once "$webCommonPath/LJCDataManagerLib.php";
 require_once "$webCommonPath/LJCDBAccessLib.php";
 
 $dataColumns = new DbColumns();
 $dataColumns->Add("FirstName", value: "First");
 $dataColumns->Add("LastName", value: "Last");
 
 $sql = LJCSQLBuilder::CreateInsert("TableName", $dataColumns);
 
 // $sql =
 // update TableName set
 //   FirstName = 'First',
 //   LastName = 'Last'

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.