PHP 8.5.0 Beta 3 available for testing

TableSelect::bind

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

TableSelect::bind โ€” select ใฎใ‚ฏใ‚จใƒชใƒ‘ใƒฉใƒกใƒผใ‚ฟใ‚’ใƒใ‚คใƒณใƒ‰ใ™ใ‚‹

่ชฌๆ˜Ž

public mysql_xdevapi\TableSelect::bind(array $placeholder_values): mysql_xdevapi\TableSelect

็‰นๅฎšใฎใƒ—ใƒฌใƒผใ‚นใƒ›ใƒซใƒ€ใƒผใฎๅ€คใ‚’ใƒใ‚คใƒณใƒ‰ใ—ใพใ™ใ€‚

ใƒ‘ใƒฉใƒกใƒผใ‚ฟ

placeholder_values

ใƒ—ใƒฌใƒผใ‚นใƒ›ใƒซใƒ€ใƒผใฎๅๅ‰ใ€ใŠใ‚ˆใณใƒใ‚คใƒณใƒ‰ใ™ใ‚‹ๅ€ค

ๆˆปใ‚Šๅ€ค

TableSelect ใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆใ‚’่ฟ”ใ—ใพใ™ใ€‚

ไพ‹

ไพ‹1 mysql_xdevapi\TableSelect::bind() ใฎไพ‹

<?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);
?>

ไธŠใฎไพ‹ใฎๅ‡บๅŠ›ใฏใ€ ใŸใจใˆใฐไปฅไธ‹ใฎใ‚ˆใ†ใซใชใ‚Šใพใ™ใ€‚

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

User Contributed Notes

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