/ LJCPHPCodeDoc / LJCDBAccessLib / LJCDbAccess / GetConnection


Returns

The PDO connection object.

Syntax

PHP
public function GetConnection()

Creates the PDO connection.

Example

PHP
 // Retrieves a record for the provided SQL statement.
 private static function GetConnection(LJCConnectionValues $connectionValues)
 {
   // See constructor for how to create $connectionValues.
   $dbAccess = new LJCDbAccess($connectionValues);
 
   $connection = $dbAccess->GetConnection();
   if (null == $connection)
   {
     echo("\r\nGetConnection() The Connection was not created.");
   }
 }

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