TableSelect::where

(No version information available, might only be in Git)

TableSelect::whereDefine los criterios de búsqueda de la selección

Descripción

public mysql_xdevapi\TableSelect::where(string $where_expr): mysql_xdevapi\TableSelect

Define las condiciones de búsqueda para filtrar.

Parámetros

where_expr

Define la condición de búsqueda para filtrar los documentos o los registros.

Valores devueltos

Un objeto TableSelect.

Ejemplos

Ejemplo #1 Ejemplo de mysql_xdevapi\TableSelect::where()

<?php
$session
= mysql_xdevapi\getSession("mysqlx://user:password@localhost");

$schema = $session->getSchema("addressbook");
$table = $schema->getTable("names");

$result = $table->select('name','age')
->
where('name like :name and age > :age')
->
bind(['name' => 'John', 'age' => 42])
->
execute();

$row = $result->fetchAll();
print_r($row);
?>

El resultado del ejemplo sería algo similar a:

Array
(
    [0] => Array
        (
            [name] => John
            [age] => 42
        )
)
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top