oci_statement_type
(PHP 5, PECL OCI8 >= 1.1.0)
oci_statement_type — بازگرداندن نوع عبارت
Description
string oci_statement_type
( resource $statement
)
بازگرداندن کلمه کلیدی نوع OCI8 statement.
Return Values
بازگرداندن نوع statement به عنوان یکی از رشتههای زیر.
| رشته بازگشتی | یادداشتها |
|---|---|
| ALTER | |
| BEGIN | |
| CALL | معرفی شده در PHP 5.2.1 (PECL OCI8 1.2.3) |
| CREATE | |
| DECLARE | |
| DELETE | |
| DROP | |
| INSERT | |
| SELECT | |
| UPDATE | |
| UNKNOWN |
بازگرداندن FALSE در صورت خطا.
Examples
Example #1 مثال oci_statement_type()
<?php
$conn = oci_connect('hr', 'welcome', 'localhost/XE');
$stid = oci_parse($conn, 'DELETE FROM departments WHERE department_id = 130;');
if (oci_statement_type($stid) == "DELETE") {
trigger_error('You are not allowed to delete from this table', E_USER_ERROR);
}
else {
oci_execute($stid); // delete the row
}
oci_free_statement($stid);
oci_close($conn);
?>
Notes
Note:
در نسخههای PHP پیش از 5.0.0 باید از ocistatementtype() استفاده کنید. The old function name can still be used in current versions, however it is deprecated and not recommended.
There are no user contributed notes for this page.
