Рекурсивный акроним словосочетания «PHP: Hypertext Preprocessor»
Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 18025 программистов и 1604 робота. Сейчас ищут 1239 программистов ...
cubrid_is_instance - Check whether the instance pointed by OID exists
Вернуться к: CUBRID Функции
cubrid_is_instance
(PECL CUBRID >= 8.3.0)
cubrid_is_instance — Check 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, $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);
?>
Результат выполнения данного примера:
Instance pointed by @0|0|0 doesn't exist.
Смотрите также
- cubrid_drop() - Delete an instance using OID
- cubrid_get_class_name() - Get the class name using OID
Вернуться к: CUBRID Функции