Back to Opencart

Class Opencart\System\Library\DB

docs/api/Opencart.System.Library.DB.html

4.1.0.34.3 KB
Original Source

Namespaces

Classes

Class Opencart[System](http://localhost\opencart-master/docs/api/namespace-Opencart.System.html)\[Library](http://localhost\opencart-master/docs/api/namespace-Opencart.System.Library.html)\[DB](http://localhost\opencart-master/docs/api/Opencart.System.Library.DB.html)

Class DB Adaptor

Located at system\library\db.php

Methods
`
public

			` | `__construct(
string $adaptor,
string $hostname,
string $username,
string $password,
string $database,
string $port = '',
string $ssl_key = '',
string $ssl_cert = '',
string $ssl_ca = '',

)`

Constructor

Constructor

| # | | `

public

			` | `query(string $sql): mixed`

Query

Query

Parameters

| $sql |

SQL statement to be executed

|

| # | | `

public

			` | `escape(string $value): string`

Escape

Escape

Parameters

| $value |

Value to be protected against SQL injections

|

Returns

Returns escaped value

| # | | `

public

			` | `countAffected(): int`

countAffected Gets the total number of affected rows from the last query

countAffected Gets the total number of affected rows from the last query

Returns

returns the total number of affected rows

| # | | `

public

			` | `getLastId(): int`

getLastId Get the last ID gets the primary key that was returned after creating a row in a table.

getLastId Get the last ID gets the primary key that was returned after creating a row in a table.

Returns

Returns last ID

| # | | `

public

			` | `isConnected(): bool`

isConnected Checks if a DB connection is active.

isConnected Checks if a DB connection is active.

| # |

OpenCart API API documentation generated by ApiGen dev-master