/ LJCPHPCodeDoc / LJCDBAccessLib / LJCDbAccess / Retrieve


Parameters
$sql - The SQL statement.

Returns

An array of record columns.

Syntax

PHP
public function Retrieve(string $sql) : ?array

Retrieves a record for the provided SQL statement.

Example

PHP
 include_once "LJCRoot.php";
 $prefix = RelativePrefix();
 include_once "$prefix/LJCPHPCommon/LJCDBAccessLib.php";
 
 // See constructor for how to create $connectionValues.
 $dbAccess = new LJCDbAccess($connectionValues);
 
 $tableName = "TableName";
 $sql = "select * from $tableName where ID = 1";
 $row = $dbAccess->Retrieve($sql);

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