cubrid_is_instance

설명

cubrid_is_instance 함수는 OID가 가리키는 인스턴스가 데이터베이스에 존재하는지 검사하는 데 사용한다.

구문

int cubrid_is_instance (resource $conn_identifier, string $oid)

리턴 값
예제

<?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, $sql, CUBRID_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);

?>

 

The above example will output:

 

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

관련 항목