Jelix 1.8.13

jDbWidget
in package

Tags
subpackage

db

Table of Contents

$_conn  : mixed
a jDbConnection object.
__construct()  : mixed
Constructor.
fetchAll()  : array<string|int, object>
Get all results of a query.
fetchAllInto()  : array<string|int, object>
Get all results of a query and store values into objects which have the given class.
fetchFirst()  : object
Run a query, and return only the first result.
fetchFirstInto()  : object
Run a query, and store values of the first result, into an object which has the given class.

Properties

Methods

__construct()

Constructor.

public __construct(mixed $connection) : mixed
Parameters
$connection : mixed
Tags
Return values
mixed

fetchAll()

Get all results of a query.

public fetchAll(string $query[, int $limitOffset = null ][, int $limitCount = null ]) : array<string|int, object>
Parameters
$query : string

SQL query

$limitOffset : int = null

the first number of the results or null

$limitCount : int = null

number of results you want, or null

Tags
Return values
array<string|int, object>

array of objects which contains results values

fetchAllInto()

Get all results of a query and store values into objects which have the given class.

public fetchAllInto(string $query, mixed $className[, int $limitOffset = null ][, int $limitCount = null ]) : array<string|int, object>
Parameters
$query : string

SQL query

$className : mixed
$limitOffset : int = null

the first number of the results or null

$limitCount : int = null

number of results you want, or null

Tags
Return values
array<string|int, object>

array of objects which contains results values

fetchFirst()

Run a query, and return only the first result.

public fetchFirst(string $query) : object
Parameters
$query : string

SQL query (without LIMIT instruction !)

Tags
Return values
object

the object which contains values of the record

fetchFirstInto()

Run a query, and store values of the first result, into an object which has the given class.

public fetchFirstInto(string $query, string $classname) : object
Parameters
$query : string

SQL query (without LIMIT instruction !)

$classname : string

class name of the future object

Tags
Return values
object

the object which contains values of the record

Search results