CodeIgniter v4.5 API

Utils extends BaseUtils
in package

Utils for MySQLi

Table of Contents

Properties

$db  : object
Database object
$listDatabases  : string
List databases statement
$optimizeTable  : string
OPTIMIZE TABLE statement
$repairTable  : bool|string
REPAIR TABLE statement

Methods

__construct()  : mixed
Class constructor
_backup()  : never
Platform dependent version of the backup function.
backup()  : false|never|string
Database Backup
databaseExists()  : bool
Determine if a particular database exists
getCSVFromResult()  : string
Generate CSV from a query result object
getXMLFromResult()  : string
Generate XML data from a query result object
listDatabases()  : array<string|int, mixed>|bool
List databases
optimizeDatabase()  : mixed
Optimize Database
optimizeTable()  : bool
Optimize Table
repairTable()  : mixed
Repair Table

Properties

$listDatabases

List databases statement

protected string $listDatabases = 'SHOW DATABASES'

$optimizeTable

OPTIMIZE TABLE statement

protected string $optimizeTable = 'OPTIMIZE TABLE %s'

$repairTable

REPAIR TABLE statement

protected bool|string $repairTable = false

Methods

_backup()

Platform dependent version of the backup function.

public _backup([array<string|int, mixed>|null $prefs = null ]) : never
Parameters
$prefs : array<string|int, mixed>|null = null
Return values
never

backup()

Database Backup

public backup([array<string|int, mixed>|string $params = [] ]) : false|never|string
Parameters
$params : array<string|int, mixed>|string = []
Tags
throws
DatabaseException
Return values
false|never|string

databaseExists()

Determine if a particular database exists

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

getCSVFromResult()

Generate CSV from a query result object

public getCSVFromResult(ResultInterface $query[, string $delim = ',' ][, string $newline = " " ][, string $enclosure = '"' ]) : string
Parameters
$query : ResultInterface
$delim : string = ','
$newline : string = " "
$enclosure : string = '"'
Return values
string

getXMLFromResult()

Generate XML data from a query result object

public getXMLFromResult(ResultInterface $query[, array<string|int, mixed> $params = [] ]) : string
Parameters
$query : ResultInterface
$params : array<string|int, mixed> = []
Return values
string

listDatabases()

List databases

public listDatabases() : array<string|int, mixed>|bool
Tags
throws
DatabaseException
Return values
array<string|int, mixed>|bool

optimizeTable()

Optimize Table

public optimizeTable(string $tableName) : bool
Parameters
$tableName : string
Tags
throws
DatabaseException
Return values
bool

repairTable()

Repair Table

public repairTable(string $tableName) : mixed
Parameters
$tableName : string
Tags
throws
DatabaseException

        
On this page

Search results