PHP 8.4.6 Released!

TableSelect::where

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

TableSelect::whereDéfinit les critères de recherche de la sélection

Description

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

Définit les conditions de recherche pour filtrer.

Liste de paramètres

where_expr

Définit la condition de recherche pour filtrer les documents ou les enregistrements.

Valeurs de retour

Un objet TableSelect.

Exemples

Exemple #1 Exemple 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);
?>

Résultat de l'exemple ci-dessus est similaire à :

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

User Contributed Notes

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

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant