/ LJCPHPCodeDoc / LJCDBAccessLib / LJCDbAccess / GetValue


Parameters
$row - The data row columns.
$columnName - The column name.

Returns

The data value.

Syntax

PHP
public static function GetValue(array $row, string $columnName)

Returns a data value if the element exists, otherwise returns null.

Remarks

Returns null if the element does not exist.

Example

PHP
 $webCommonPath = "c:/inetpub/wwwroot/LJCPHPCommon";
 require_once "$webCommonPath/LJCDBAccessLib.php";
 
 // See constructor for how to create $connectionValues.
 $dbAccess = new LJCDbAccess($connectionValues);
 
 $tableName = "TableName";
 $sql = "select ID, Name from $tableName where ID = 1";
 $row = $dbAccess->Retrieve($sql);
 $id = LJCDbAccess::GetValue($row, "ID");
 $name = LJCDbAccess::GetValue($row, "Name");

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