GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • CodeIgniter v4.7 API

This view

  • Original page
  • New address

GeezerVison is showing codeigniter4.github.io — CodeIgniter v4.7 API

Menu

Namespaces

CodeIgniter

  • API
  • Autoloader
  • Cache
  • CLI
  • Commands
  • Config
  • Cookie
  • Database
  • DataCaster
  • DataConverter
  • Debug
  • Email
  • Encryption
  • Entity
  • Events
  • Exceptions
  • Files
  • Filters
  • Format
  • Helpers
  • Honeypot
  • HTTP
  • I18n
  • Images
  • Language
  • Log
  • Modules
  • Pager
  • Publisher
  • RESTful
  • Router
  • Security
  • Session
  • Test
  • Throttle
  • Traits
  • Typography
  • Validation
  • View

Packages

Application

Reports

Deprecated

Errors

Markers

Indices

Files

  • CodeIgniter
  • Database

ConnectionInterface
in
  • Application

ConnectionInterface.php : 23
Tags
template

Table of Contents

Properties

$connID  : false|object|resource
$DBDriver  : string

Methods

callFunction()  : mixed
Allows for custom calls to the database engine that are not supported through our database layer.
connect()  : false|TConnection
Connect to the database.
error()  : array{code: int|string|null, message: string|null}
Returns the last error encountered by this connection.
escape()  : ($str is array ? array : float|int|string)
"Smart" Escaping
getConnection()  : false|TConnection
Returns the actual connection object. If both a 'read' and 'write' connection has been specified, you can pass either term in to get that connection. If you pass either alias in and only a single connection is present, it must return the sole connection.
getDatabase()  : string
Returns the name of the current database being used.
getLastQuery()  : Query
Returns the last query's statement object.
getPlatform()  : string
The name of the platform in use (MySQLi, mssql, etc)
getVersion()  : string
Returns a string containing the version of the database being used.
initialize()  : void
Initializes the database connection/settings.
isWriteType()  : bool
Determines if the statement is a write-type query or not.
persistentConnect()  : false|TConnection
Create a persistent database connection.
query()  : BaseResult<TConnection, TResult>|bool|Query
Orchestrates a query against the database. Queries must use Database\Statement objects to store the query and build it.
reconnect()  : void
Keep or establish the connection if no queries have been sent for a length of time exceeding the server's idle timeout.
setDatabase()  : bool
Select a specific database table to use.
simpleQuery()  : false|TResult
Performs a basic query against the database. No binding or caching is performed, nor are transactions handled. Simply takes a raw query string and returns the database-specific result id.
table()  : BaseBuilder
Returns an instance of the query builder for this connection.

Properties

$connID

ConnectionInterface.php : 0
public false|object|resource $connID

$DBDriver read-only

ConnectionInterface.php : 0
public string $DBDriver

Methods

callFunction()

ConnectionInterface.php : 154

Allows for custom calls to the database engine that are not supported through our database layer.

public callFunction(string $functionName, mixed ...$params) : mixed
Parameters
$functionName : string
$params : mixed

connect()

ConnectionInterface.php : 37

Connect to the database.

public connect([bool $persistent = false ]) : false|TConnection
Parameters
$persistent : bool = false
Return values
false|TConnection

error()

ConnectionInterface.php : 83

Returns the last error encountered by this connection.

public error() : array{code: int|string|null, message: string|null}

Must return this format: ['code' => string|int, 'message' => string] intval(code) === 0 means "no error".

Return values
array{code: int|string|null, message: string|null}

escape()

ConnectionInterface.php : 144

"Smart" Escaping

public escape(mixed $str) : ($str is array ? array : float|int|string)

Escapes data based on type. Sets boolean and null types.

Parameters
$str : mixed
Return values
($str is array ? array : float|int|string)

getConnection()

ConnectionInterface.php : 62

Returns the actual connection object. If both a 'read' and 'write' connection has been specified, you can pass either term in to get that connection. If you pass either alias in and only a single connection is present, it must return the sole connection.

public getConnection([string|null $alias = null ]) : false|TConnection
Parameters
$alias : string|null = null
Return values
false|TConnection

getDatabase()

ConnectionInterface.php : 74

Returns the name of the current database being used.

public getDatabase() : string
Return values
string

getLastQuery()

ConnectionInterface.php : 132

Returns the last query's statement object.

public getLastQuery() : Query
Return values
Query

getPlatform()

ConnectionInterface.php : 88

The name of the platform in use (MySQLi, mssql, etc)

public getPlatform() : string
Return values
string

getVersion()

ConnectionInterface.php : 93

Returns a string containing the version of the database being used.

public getVersion() : string
Return values
string

initialize()

ConnectionInterface.php : 30

Initializes the database connection/settings.

public initialize() : void

isWriteType()

ConnectionInterface.php : 161

Determines if the statement is a write-type query or not.

public isWriteType(string $sql) : bool
Parameters
$sql : string
Return values
bool

persistentConnect()

ConnectionInterface.php : 44

Create a persistent database connection.

public persistentConnect() : false|TConnection
Return values
false|TConnection

query()

ConnectionInterface.php : 107

Orchestrates a query against the database. Queries must use Database\Statement objects to store the query and build it.

public query(string $sql[, array<string|int, mixed>|string|null $binds = null ]) : BaseResult<TConnection, TResult>|bool|Query

This method works with the cache.

Should automatically handle different connections for read/write queries if needed.

Parameters
$sql : string
$binds : array<string|int, mixed>|string|null = null
Return values
BaseResult<TConnection, TResult>|bool|Query

reconnect()

ConnectionInterface.php : 52

Keep or establish the connection if no queries have been sent for a length of time exceeding the server's idle timeout.

public reconnect() : void

setDatabase()

ConnectionInterface.php : 69

Select a specific database table to use.

public setDatabase(string $databaseName) : bool
Parameters
$databaseName : string
Return values
bool

simpleQuery()

ConnectionInterface.php : 116

Performs a basic query against the database. No binding or caching is performed, nor are transactions handled. Simply takes a raw query string and returns the database-specific result id.

public simpleQuery(string $sql) : false|TResult
Parameters
$sql : string
Return values
false|TResult

table()

ConnectionInterface.php : 125

Returns an instance of the query builder for this connection.

public table(array<string|int, string>|string $tableName) : BaseBuilder
Parameters
$tableName : array<string|int, string>|string

Table name.

Return values
BaseBuilder —

Builder.

On this page
  • Table Of Contents
    • Properties
    • Methods
  • Properties
    • $connID
    • $DBDriver
  • Methods
    • callFunction()
    • connect()
    • error()
    • escape()
    • getConnection()
    • getDatabase()
    • getLastQuery()
    • getPlatform()
    • getVersion()
    • initialize()
    • isWriteType()
    • persistentConnect()
    • query()
    • reconnect()
    • setDatabase()
    • simpleQuery()
    • table()
    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.