phpDocumentor

MydbInterface extends EncoderInterface, CommandInterface, QueryInterface, DataManipulationStatementsInterface, TransactionInterface, AdministrationStatementsInterface

Tags
author

Sergei Shilko contact@sshilko.com

license

https://opensource.org/licenses/mit-license.php MIT

see
https://github.com/sshilko/php-sql-mydb

Table of Contents

Methods

beginTransaction()  : void
command()  : bool
Execute any SQL command, without returning result
commitTransaction()  : void
delete()  : int|null
deleteWhere()  : int|null
escape()  : string
Escape value for the SQL query
getEnumValues()  : array<string|int, string>
getPrimaryKeys()  : array<string|int, string>|null
Get table primary keys
insert()  : string|null
insertMany()  : void
insertOne()  : string|null
query()  : array<string|int, mixed>|null
replace()  : string|null
replaceOne()  : string|null
rollbackTransaction()  : void
select()  : array<string|int, mixed>|null
update()  : int|null
updateWhere()  : int|null
updateWhereMany()  : void

Methods

command()

Execute any SQL command, without returning result

public command(string $query) : bool
Parameters
$query : string

sql command

Return values
bool

true success or false on failure

deleteWhere()

public deleteWhere(array<string|int, mixed> $whereFields, string $table[, array<string|int, mixed> $whereNotFields = [] ]) : int|null
Parameters
$whereFields : array<string|int, mixed>
$table : string
$whereNotFields : array<string|int, mixed> = []
Return values
int|null

getEnumValues()

public getEnumValues(string $table, string $column) : array<string|int, string>
Parameters
$table : string
$column : string
Return values
array<string|int, string>

getPrimaryKeys()

Get table primary keys

public getPrimaryKeys(string $table) : array<string|int, string>|null
Parameters
$table : string
Return values
array<string|int, string>|null

insertMany()

public insertMany(array<string|int, mixed> $data, array<string|int, string> $cols, string $table[, bool $ignore = false ][, string $onDuplicateSql = '' ]) : void
Parameters
$data : array<string|int, mixed>
$cols : array<string|int, string>
$table : string
$ignore : bool = false
$onDuplicateSql : string = ''
Tags
psalm-param

array<array-key, array<(float|int|string|\sql\MydbExpressionInterface|null)>> $data

query()

public query(string $query) : array<string|int, mixed>|null
Parameters
$query : string
Tags
phpcs:disable

SlevomatCodingStandard.TypeHints.ReturnTypeHint

Return values
array<string|int, mixed>|null

updateWhere()

public updateWhere(array<string, float|int|string|MydbExpressionInterface|null> $update, array<string|int, mixed> $whereFields, string $table[, array<string|int, mixed> $whereNotFields = [] ]) : int|null
Parameters
$update : array<string, float|int|string|MydbExpressionInterface|null>
$whereFields : array<string|int, mixed>
$table : string
$whereNotFields : array<string|int, mixed> = []
Return values
int|null

updateWhereMany()

public updateWhereMany(array<string|int, mixed> $columnSetWhere, array<string|int, mixed> $where, string $table) : void
Parameters
$columnSetWhere : array<string|int, mixed>
$where : array<string|int, mixed>
$table : string

        
On this page

Search results