PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

cubrid_is_instance - Check whether the instance pointed by OID exists | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

cubrid_is_instance

(PECL CUBRID >= 8.3.0)

cubrid_is_instanceCheck whether the instance pointed by OID exists

説明

int cubrid_is_instance ( resource $conn_identifier , string $oid )

The cubrid_is_instance() function is used to check whether the instance pointed by the given oid exists or not.

パラメータ

conn_identifier

Connection identifier.

oid

OID of the instance that you want to check the existence.

返り値

1, if such instance exists;

0, if such instance does not exist;

-1, in case of error

例1 cubrid_is_instance() example

<?php
$conn 
cubrid_connect("localhost"33000"demodb");

$sql = <<<EOD
SELECT host_year, medal, game_date 
FROM game 
WHERE athlete_code IN 
    (SELECT code FROM athlete WHERE name='Thorpe Ian');
EOD;

$req cubrid_execute($conn$sqlCUBRID_INCLUDE_OID);
$oid cubrid_current_oid($req);

$res cubrid_is_instance ($conn$oid);
if (
$res == 1) {
    echo 
"Instance pointed by $oid exists.\n";
} else if (
$res == 0){
    echo 
"Instance pointed by $oid doesn't exist.\n";
} else {
    echo 
"error\n";
}

cubrid_disconnect($conn);
?>

上の例の出力は以下となります。

Instance pointed by @0|0|0 doesn't exist.

参考


忘却曲線を使ってこの関数を確実に記憶に残す

フォーラムで「cubrid_is_instance - Check whether the instance pointed by OID exists」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | cubrid_is_instance - Check whether the instance pointed by OID exists」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: