mysqli_stmt ใ‚ฏใƒฉใ‚น

(PHP 5, PHP 7, PHP 8)

ใฏใ˜ใ‚ใซ

ใƒ—ใƒชใƒšใ‚ขใƒ‰ใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใ‚’่กจใ—ใพใ™ใ€‚

ใ‚ฏใƒฉใ‚นๆฆ‚่ฆ

class mysqli_stmt {
/* ใƒ—ใƒญใƒ‘ใƒ†ใ‚ฃ */
public readonly int|string $affected_rows;
public readonly int|string $insert_id;
public readonly int|string $num_rows;
public readonly int $param_count;
public readonly int $field_count;
public readonly int $errno;
public readonly string $error;
public readonly array $error_list;
public readonly string $sqlstate;
public int $id;
/* ใƒกใ‚ฝใƒƒใƒ‰ */
public function __construct(mysqli $mysql, ?string $query = null)
public function attr_get(int $attribute): int
public function attr_set(int $attribute, int $value): bool
public function bind_param(string $types, mixed &$var, mixed &...$vars): bool
public function bind_result(mixed &$var, mixed &...$vars): bool
public function close(): true
public function data_seek(int $offset): void
public function execute(?array $params = null): bool
public function fetch(): ?bool
public function free_result(): void
public function get_result(): mysqli_result|false
public function get_warnings(): mysqli_warning|false
public function more_results(): bool
public function next_result(): bool
public function num_rows(): int|string
public function prepare(string $query): bool
public function reset(): bool
public function send_long_data(int $param_num, string $data): bool
public function store_result(): bool
}

ใƒ—ใƒญใƒ‘ใƒ†ใ‚ฃ

id

ใƒ—ใƒชใƒšใ‚ขใƒ‰ใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใฎ ID ใ‚’ไฟๆŒใ—ใพใ™ใ€‚

็›ฎๆฌก

  • mysqli_stmt::$affected_rows โ€” ็›ด่ฟ‘ใซๅฎŸ่กŒใ•ใ‚ŒใŸใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใงๅค‰ๆ›ดใƒปๅ‰Š้™คใƒป่ฟฝๅŠ ใ€ใ‚ใ‚‹ใ„ใฏ้ธๆŠžใ•ใ‚ŒใŸ่กŒใฎ็ทๆ•ฐใ‚’่ฟ”ใ™
  • mysqli_stmt::attr_get โ€” ใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใฎๅฑžๆ€งใฎ็พๅœจใฎๅ€คใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • mysqli_stmt::attr_set โ€” ใƒ—ใƒชใƒšใ‚ขใƒ‰ใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใฎๆŒฏใ‚‹่ˆžใ„ใ‚’ๅค‰ๆ›ดใ™ใ‚‹
  • mysqli_stmt::bind_param โ€” ใƒ—ใƒชใƒšใ‚ขใƒ‰ใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใฎใƒ‘ใƒฉใƒกใƒผใ‚ฟใซๅค‰ๆ•ฐใ‚’ใƒใ‚คใƒณใƒ‰ใ™ใ‚‹
  • mysqli_stmt::bind_result โ€” ็ตๆžœใ‚’ไฟๅญ˜ใ™ใ‚‹ใŸใ‚ใ€ใƒ—ใƒชใƒšใ‚ขใƒ‰ใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใซๅค‰ๆ•ฐใ‚’ใƒใ‚คใƒณใƒ‰ใ™ใ‚‹
  • mysqli_stmt::close โ€” ใƒ—ใƒชใƒšใ‚ขใƒ‰ใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใ‚’้–‰ใ˜ใ‚‹
  • mysqli_stmt::__construct โ€” ๆ–ฐใ—ใ„ mysqli_stmt ใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆใ‚’ๆง‹็ฏ‰ใ™ใ‚‹
  • mysqli_stmt::data_seek โ€” ใƒใƒƒใƒ•ใ‚กใƒชใƒณใ‚ฐใ•ใ‚ŒใŸ็ตๆžœไธญใฎใ€ไปปๆ„ใฎ่กŒใซใƒใ‚คใƒณใ‚ฟใ‚’็งปๅ‹•ใ™ใ‚‹
  • mysqli_stmt::$errno โ€” ็›ด่ฟ‘ใฎใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใฎใ‚ณใƒผใƒซใซ้–ขใ™ใ‚‹ใ‚จใƒฉใƒผใ‚ณใƒผใƒ‰ใ‚’่ฟ”ใ™
  • mysqli_stmt::$error โ€” ็›ด่ฟ‘ใฎใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใฎใ‚จใƒฉใƒผๅ†…ๅฎนใ‚’ๆ–‡ๅญ—ๅˆ—ใง่ฟ”ใ™
  • mysqli_stmt::$error_list โ€” ็›ด่ฟ‘ใงๅฎŸ่กŒใ—ใŸใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใ‹ใ‚‰ใฎใ‚จใƒฉใƒผใฎไธ€่ฆงใ‚’่ฟ”ใ™
  • mysqli_stmt::execute โ€” ใƒ—ใƒชใƒšใ‚ขใƒ‰ใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใ‚’ๅฎŸ่กŒใ™ใ‚‹
  • mysqli_stmt::fetch โ€” ใƒ—ใƒชใƒšใ‚ขใƒ‰ใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใ‹ใ‚‰็ตๆžœใ‚’ๅ–ๅพ—ใ—ใ€ใƒใ‚คใƒณใƒ‰ๅค‰ๆ•ฐใซๆ ผ็ดใ™ใ‚‹
  • mysqli_stmt::$field_count โ€” ๆŒ‡ๅฎšใ—ใŸใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใฎใ‚ซใƒฉใƒ ๆ•ฐใ‚’่ฟ”ใ™
  • mysqli_stmt::free_result โ€” ๆŒ‡ๅฎšใ—ใŸใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใƒใƒณใƒ‰ใƒซใฎ็ตๆžœใ‚’ๆ ผ็ดใ—ใŸใƒกใƒขใƒชใ‚’่งฃๆ”พใ™ใ‚‹
  • mysqli_stmt::get_result โ€” ใƒ—ใƒชใƒšใ‚ขใƒ‰ใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใ‹ใ‚‰็ตๆžœใ‚’ mysqli_result ใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆใจใ—ใฆๅ–ๅพ—ใ™ใ‚‹
  • mysqli_stmt::get_warnings โ€” SHOW WARNINGS ใฎ็ตๆžœใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • mysqli_stmt::$insert_id โ€” ็›ด่ฟ‘ใฎ INSERT ๆ“ไฝœใง็”Ÿๆˆใ—ใŸ ID ใ‚’ๅ–ๅพ—ใ™ใ‚‹
  • mysqli_stmt::more_results โ€” ่ค‡ๆ•ฐใ‚ฏใ‚จใƒชใงใ€ๆฌกใฎ็ตๆžœใŒๅญ˜ๅœจใ™ใ‚‹ใ‹ใฉใ†ใ‹ใ‚’่ชฟในใ‚‹
  • mysqli_stmt::next_result โ€” ่ค‡ๆ•ฐใ‚ฏใ‚จใƒชใ‹ใ‚‰ใ€ๆฌกใฎ็ตๆžœใ‚’่ชญใฟ่พผใ‚€
  • mysqli_stmt::$num_rows โ€” ใ‚ตใƒผใƒใƒผใ‹ใ‚‰ๅ–ๅพ—ใ—ใŸ็ตๆžœใ‚ปใƒƒใƒˆใฎ่กŒๆ•ฐใ‚’่ฟ”ใ™
  • mysqli_stmt::$param_count โ€” ๆŒ‡ๅฎšใ—ใŸใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใฎใƒ‘ใƒฉใƒกใƒผใ‚ฟๆ•ฐใ‚’่ฟ”ใ™
  • mysqli_stmt::prepare โ€” SQL ใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใ‚’ๅฎŸ่กŒใ™ใ‚‹ใŸใ‚ใซๆบ–ๅ‚™ใ™ใ‚‹
  • mysqli_stmt::reset โ€” ใƒ—ใƒชใƒšใ‚ขใƒ‰ใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใ‚’ใƒชใ‚ปใƒƒใƒˆใ™ใ‚‹
  • mysqli_stmt::result_metadata โ€” ใƒ—ใƒชใƒšใ‚ขใƒ‰ใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใ‹ใ‚‰็ตๆžœใ‚ปใƒƒใƒˆใฎใƒกใ‚ฟใƒ‡ใƒผใ‚ฟใ‚’่ฟ”ใ™
  • mysqli_stmt::send_long_data โ€” ใƒ‡ใƒผใ‚ฟใ‚’ใƒ–ใƒญใƒƒใ‚ฏใง้€ไฟกใ™ใ‚‹
  • mysqli_stmt::$sqlstate โ€” ็›ดๅ‰ใฎใ‚นใƒ†ใƒผใƒˆใƒกใƒณใƒˆใฎๆ“ไฝœใงใฎ SQLSTATE ใ‚จใƒฉใƒผใ‚’่ฟ”ใ™
  • mysqli_stmt::store_result โ€” ๅ†…้ƒจใƒใƒƒใƒ•ใ‚กใซ็ตๆžœใ‚’ไฟๅญ˜ใ™ใ‚‹
๏ผ‹add a note

User Contributed Notes

There are no user contributed notes for this page.