PHP 8.5.0 Beta 3 available for testing

Table::update

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

Table::update โ€” ใƒ†ใƒผใƒ–ใƒซใฎ่กŒใ‚’ๆ›ดๆ–ฐใ™ใ‚‹

่ชฌๆ˜Ž

public mysql_xdevapi\Table::update(): mysql_xdevapi\TableUpdate

ใƒ†ใƒผใƒ–ใƒซใฎใ‚ซใƒฉใƒ ใ‚’ๆ›ดๆ–ฐใ—ใพใ™ใ€‚

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

ใ“ใฎ้–ขๆ•ฐใซใฏใƒ‘ใƒฉใƒกใƒผใ‚ฟใฏใ‚ใ‚Šใพใ›ใ‚“ใ€‚

ๆˆปใ‚Šๅ€ค

TableUpdate ใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆใ‚’่ฟ”ใ—ใพใ™ใ€‚ update ๆ–‡ใ‚’ๅฎŸ่กŒใ™ใ‚‹ใซใฏใ€execute() ใƒกใ‚ฝใƒƒใƒ‰ใ‚’ไฝฟใฃใฆใใ ใ•ใ„ใ€‚

ไพ‹

ไพ‹1 mysql_xdevapi\Table::update() ใฎไพ‹

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

$session->sql("DROP DATABASE IF EXISTS addressbook")->execute();
$session->sql("CREATE DATABASE addressbook")->execute();
$session->sql("CREATE TABLE addressbook.names(name text, age int)")->execute();
$session->sql("INSERT INTO addressbook.names values ('John', 42), ('Sam', 33)")->execute();

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

$table->update()->set('age',34)->where('name = "Sam"')->limit(1)->execute();
?>
๏ผ‹add a note

User Contributed Notes

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