= PECL_CUBRID_8_3_0 // cubrid_close_prepare() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_close_request() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_col_get() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_col_size() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_column_names() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_column_types() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_commit() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_connect_with_url() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_connect() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_current_oid() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_disconnect() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_drop() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_error_code_facility() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_error_code() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_error_msg() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_execute() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_fetch() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_free_result() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_get_autocommit() - PECL_CUBRID >= PECL_CUBRID_8_4_0 // cubrid_get_charset() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_get_class_name() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_get_client_info() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_get_db_parameter() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_get_query_timeout() - PECL_CUBRID >= PECL_CUBRID_8_4_1 // cubrid_get_server_info() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_get() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_insert_id() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_is_instance() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_lob_close() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_lob_export() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_lob_get() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_lob_send() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_lob_size() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_lob2_bind() - PECL_CUBRID >= PECL_CUBRID_8_4_1 // cubrid_lob2_close() - PECL_CUBRID >= PECL_CUBRID_8_4_1 // cubrid_lob2_export() - PECL_CUBRID >= PECL_CUBRID_8_4_1 // cubrid_lob2_import() - PECL_CUBRID >= PECL_CUBRID_8_4_1 // cubrid_lob2_new() - PECL_CUBRID >= PECL_CUBRID_8_4_1 // cubrid_lob2_read() - PECL_CUBRID >= PECL_CUBRID_8_4_1 // cubrid_lob2_seek64() - PECL_CUBRID >= PECL_CUBRID_8_4_1 // cubrid_lob2_seek() - PECL_CUBRID >= PECL_CUBRID_8_4_1 // cubrid_lob2_size64() - PECL_CUBRID >= PECL_CUBRID_8_4_1 // cubrid_lob2_size() - PECL_CUBRID >= PECL_CUBRID_8_4_1 // cubrid_lob2_tell64() - PECL_CUBRID >= PECL_CUBRID_8_4_1 // cubrid_lob2_tell() - PECL_CUBRID >= PECL_CUBRID_8_4_1 // cubrid_lob2_write() - PECL_CUBRID >= PECL_CUBRID_8_4_1 // cubrid_lock_read() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_lock_write() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_move_cursor() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_next_result() - PECL_CUBRID >= PECL_CUBRID_8_4_0 // cubrid_num_cols() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_num_rows() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_pconnect_with_url() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_pconnect() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_prepare() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_put() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_rollback() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_schema() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_seq_drop() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_seq_insert() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_seq_put() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_set_add() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_set_autocommit() - PECL_CUBRID >= PECL_CUBRID_8_4_0 // cubrid_set_db_parameter() - PECL_CUBRID >= PECL_CUBRID_8_4_0 // cubrid_set_drop() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_set_query_timeout() - PECL_CUBRID >= PECL_CUBRID_8_4_1 // cubrid_version() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_affected_rows() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_client_encoding() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_close() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_data_seek() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_db_name() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_errno() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_error() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_fetch_array() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_fetch_assoc() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_fetch_field() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_fetch_lengths() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_fetch_object() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_fetch_row() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_field_flags() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_field_len() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_field_name() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_field_seek() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_field_table() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_field_type() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_list_dbs() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_num_fields() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_ping() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_query() - PECL_CUBRID >= PECL_CUBRID_8_3_1 // cubrid_real_escape_string() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_result() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_unbuffered_query() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_load_from_glo() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_new_glo() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_save_to_glo() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // cubrid_send_glo() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // ============================== USING CLASSES (0) // ============================== USING DATA_TYPES (7) // bool // resource // int // mixed // string // array // object // ============================== END // REQUIREMENTS // ============================== // ============================== BEGIN // PHP_DATABASE_VENDOR_CUBRID // ============================== ABOUT // PHP Manual / Function Reference / Database Extensions / Vendor Specific Database Extensions / CUBRID // URL: https://www.php.net/manual/en/book.cubrid.php // ============================== DESCRIPTION // CUBRID // // CUBRID - BEGIN // CUBRID // // INTRODUCTION // INSTALLING_CONFIGURING // PREDEFINED_CONSTANTS // EXAMPLES // CUBRID_FUNCTIONS // CUBRID_MYSQL_COMPATIBILITY_FUNCTIONS // CUBRID_OBSOLETE_ALIASES_AND_FUNCTIONS // // INTRODUCTION - BEGIN // Introduction // // These functions allow you to access CUBRID database servers. More information about CUBRID can be found at > CUBRID. // Documentation for CUBRID can be found at > CUBRID Documentation. // // LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/book.cubrid.php // INTRODUCTION - END // // INSTALLING_CONFIGURING - BEGIN // Installing/Configuring // // REQUIREMENTS // INSTALLATION // RUNTIME_CONFIGURATION // RESOURCE_TYPES // // REQUIREMENTS - BEGIN // Requirements // // In order to have these functions available, you must install CUBRID, and compile CUBRID PHP Library with CUBRID support. // // LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/cubrid.requirements.php // REQUIREMENTS - END // // INSTALLATION - BEGIN // Installation // // Information for installing this PECL extension may be found in the manual chapter titled Installation of PECL extensions. Additional information such as new releases, downloads, source files, maintainer information, and a CHANGELOG, can be located here: > https://pecl.php.net/package/cubrid. // A DLL for this PECL extension is currently unavailable. See also the building on Windows section. // For information about manual installation on Linux and Windows systems, please read the file build-guide.html included in the package. // // LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/cubrid.installation.php // INSTALLATION - END // // RUNTIME_CONFIGURATION - BEGIN // Runtime Configuration // // There is no runtime configuration now. // // LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/cubrid.configuration.php // RUNTIME_CONFIGURATION - END // // RESOURCE_TYPES - BEGIN // Resource Types // // There are four resource types used in CUBRID. The first one is the link identifier for a database connection, the second is the a resource which holds the result of a query, and the last two a resource which holds the query results of BLOB/CLOB data types. // // connection identifier - A connection identifier returned by cubrid_connect(), cubrid_connect_with_url(), cubrid_pconnect() and cubrid_pconnect_with_url(). // request identifier - A request identifier returned by cubrid_prepare() and cubrid_execute(). // LOB identifier - A LOB identifier returned by cubrid_lob_get(). // LOB2 identifier - A LOB identifier returned by cubrid_lob2_new() or get from the result set. // // LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/cubrid.resources.php // RESOURCE_TYPES - END // // LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/cubrid.setup.php // INSTALLING_CONFIGURING - END // // PREDEFINED_CONSTANTS - BEGIN // Predefined Constants // // The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime. // // The following constants can be used when executing SQL statement. They can be passed to cubrid_prepare() and cubrid_execute(). // // CUBRID SQL execution flags // Constant - Description // CUBRID_INCLUDE_OID - Determine whether to get OID during query execution. // CUBRID_ASYNC - Execute the query in asynchronous mode. // CUBRID_EXEC_QUERY_ALL - Execute the query in synchronous mode. This flag must be set when executing multiple SQL statements. // // The following constants can be used when fetching the results to specify fetch behaviour. They can be passed to cubrid_fetch() and cubrid_fetch_array(). // // CUBRID fetch flags // Constant - Description // CUBRID_NUM - Get query result as a numeric array (0-default). // CUBRID_ASSOC - Get query result as an associative array. // CUBRID_BOTH - Get query result as both numeric and associative arrays (default value). // CUBRID_OBJECT - Get query result an object. // CUBRID_LOB - The constant CUBRID_LOB can be used when you want to operate the lob object. It can be passed to cubrid_fetch(), cubrid_fetch_row(), cubrid_fetch_array(), cubrid_fetch_assoc() and cubrid_fetch_object(). // // The following constants can be used when positioning the cursor in query results. They can be passed to or returned by cubrid_move_cursor(). // // CUBRID cursor position flags // Constant - Description // CUBRID_CURSOR_FIRST - Move current cursor to the first position in the result. // CUBRID_CURSOR_CURRENT - Move current cursor as a default value if the origin is not specified. // CUBRID_CURSOR_LAST - Move current cursor to the last position in the result. // CUBRID_CURSOR_SUCCESS - Returned value of cubrid_move_cursor() function in case of success. This flag has been removed from 8.4.1. // CUBRID_NO_MORE_DATA - Returned value of cubrid_move_cursor() function in case of failure. This flag has been removed from 8.4.1. // CUBRID_CURSOR_ERROR - Returned value of cubrid_move_cursor() function in case of failure. This flag has been removed from 8.4.1. // // The following constants can be used when setting the auto-commit mode for the database connection. They can be passed to cubrid_set_autocommit() or returned by cubrid_get_autocommit(). // // CUBRID auto-commit mode flags // Constant - Description // CUBRID_AUTOCOMMIT_TRUE - Enable the auto-commit mode. // CUBRID_AUTOCOMMIT_FALSE - Disable the auto-commit mode. // // The following constants can be used when setting the database parameter. They can be passed to cubrid_set_db_parameter(). // // CUBRID parameter flags // Constant - Description // CUBRID_PARAM_ISOLATION_LEVEL - Transaction isolation level for the database connection. // CUBRID_PARAM_LOCK_TIMEOUT - Transaction timeout in seconds. // // The following constants can be used when setting the transaction isolation level. They can be passed to cubrid_set_db_parameter() or returned by cubrid_get_db_parameter(). // // CUBRID isolation level flags // Constant - Description // TRAN_COMMIT_CLASS_UNCOMMIT_INSTANCE - The lowest isolation level (1). A dirty, non-repeatable or phantom read may occur for the tuple and a non-repeatable read may occur for the table as well. // TRAN_COMMIT_CLASS_COMMIT_INSTANCE - A relatively low isolation level (2). A dirty read does not occur, but non-repeatable or phantom read may occur. // TRAN_REP_CLASS_UNCOMMIT_INSTANCE - The default isolation of CUBRID (3). A dirty, non-repeatable or phantom read may occur for the tuple, but repeatable read is ensured for the table. // TRAN_REP_CLASS_COMMIT_INSTANCE - A relatively low isolation level (4). A dirty read does not occur, but non-repeatable or phantom read may. // TRAN_REP_CLASS_REP_INSTANCE - A relatively high isolation level (5). A dirty or non-repeatable read does not occur, but a phantom read may. // TRAN_SERIALIZABLE - The highest isolation level (6). Problems concerning concurrency (e.g. dirty read, non-repeatable read, phantom read, etc.) do not occur. // // The following constants can be used when getting schema information. They can be passed to cubrid_schema(). // // CUBRID schema flags // Constant - Description // CUBRID_SCH_CLASS - Get name and type of table in CUBRID. // CUBRID_SCH_VCLASS - Get name and type of view in CUBRID. // CUBRID_SCH_QUERY_SPEC - Get the query definition of view. // CUBRID_SCH_ATTRIBUTE - Get the attributes of table column. // CUBRID_SCH_CLASS_ATTRIBUTE - Get the attributes of table. // CUBRID_SCH_METHOD - Get the instance method. The instance method is a method called by a class instance. It is used more often than the class method because most operations are executed in the instance. // CUBRID_SCH_CLASS_METHOD - Get the class method. The class method is a method called by a class object. It is usually used to create a new class instance or to initialize it. It is also used to access or update class attributes. // CUBRID_SCH_METHOD_FILE - Get the information of the file where the method of the table is defined. // CUBRID_SCH_SUPERCLASS - Get the name and type of table which table inherites attributes from. // CUBRID_SCH_SUBCLASS - Get the name and type of table which inherites attributes from this table. // CUBRID_SCH_CONSTRAINT - Get the table constraints. // CUBRID_SCH_TRIGGER - Get the table triggers. // CUBRID_SCH_CLASS_PRIVILEGE - Get the privilege information of table. // CUBRID_SCH_ATTR_PRIVILEGE - Get the privilege information of column. // CUBRID_SCH_DIRECT_SUPER_CLASS - Get the direct super table of table. // CUBRID_SCH_PRIMARY_KEY - Get the table primary key. // CUBRID_SCH_IMPORTED_KEYS - Get imported keys of table. // CUBRID_SCH_EXPORTED_KEYS - Get exported keys of table. // CUBRID_SCH_CROSS_REFERENCE - Get reference relationship of tow tables. // // The following constants can be used when reporting errors. They can be returned from cubrid_error_code_facility(). // // CUBRID error facility code // Constant - Description // CUBRID_FACILITY_DBMS - The error occurred in CUBRID dbms. // CUBRID_FACILITY_CAS - The error occurred in CUBRID broker cas. // CUBRID_FACILITY_CCI - The error occurred in CUBRID cci. // CUBRID_FACILITY_CLIENT - The error occurred in CUBRID PHP client. // // LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/cubrid.constants.php // PREDEFINED_CONSTANTS - END // // EXAMPLES - BEGIN // Examples // // The following is a simple example that establishes a connection between PHP and CUBRID. This section will cover the most basic and notable features. The following code required to connect to CUBRID database, which means CUBRID Server and CUBRID Broker have to be running. // The example below uses the demodb database as an examples. By default it is created during the installation. Make sure it has been created. // [example] // Example #1 Example of Data Retrieval // [code] // // // // // //
// // [php] // /** // * Set server information for CUBRID connection. host_ip is the IP // * address where the CUBRID Broker is installed (localhost in this // * example), and host_port is the port number of the CUBRID Broker. // * The port number is the default given during the installation. // * For details, see "Administrator's Guide." // */ // $host_ip = "localhost"; // $host_port = 33000; // $db_name = "demodb"; // /** // * Connect to CUBRID Server. Do not make the actual connection, but // * only retain the connection information. The reason for not making // * the actual connection is to handle transaction more efficiently // * in the 3-tier architecture. // */ // $cubrid_con = @cubrid_connect($host_ip, $host_port, $db_name); // // if (!$cubrid_con) { // echo "Database Connection Error"; // exit; // } // [/php] // [php] // $sql = "select sports, count(players) as players from event group by sports"; // /** // * Request the CUBRID Server for the results of the SQL statement. // * Now make the actual connection to the CUBRID Server. // */ // $result = cubrid_execute($cubrid_con, $sql); // // if ($result) { // /** // * Get the column names from the result set created by the SQL query. // */ // $columns = cubrid_column_names($result); // /** // * Get the number of columns in the result set created by the SQL query. // */ // $num_fields = cubrid_num_cols($result); // /** // * List the column names of the result set on the screen. // */ // echo ""; // // while (list($key, $colname) = each($columns)) { // echo ""; // } // // echo ""; // // /** // * Get the results from the result set. // */ // while ($row = cubrid_fetch($result)) { // echo ""; // // for ($i = 0; $i < $num_fields; $i++) { // echo ""; // } // // echo ""; // } // } // /** // * The PHP module in the CUBRID runs in a 3-tier architecture. Even when // * calling SELECT for transaction processing, it is processed as a part // * of the transaction. Therefore, the transaction needs to be rolled back // * by calling commit or rollback even though SELECT was called for smooth // * performance. // */ // cubrid_commit($cubrid_con); // cubrid_disconnect($cubrid_con); // [/php] // // // [/code] // [/example] // [example] // Example #2 Example of Data Insertion // [code] // // // // // //
//
$colname
"; // echo $row[$i]; // echo "
// [php] // /** // * host_ip is the IP address where the CUBRID Broker is installed // * host_port is the port number of the CUBRID Broker // * db_name is the name of CUBRID Database // */ // $host_ip = "localhost"; // $host_port = 33000; // $db_name = "demodb"; // $cubrid_con = @cubrid_connect($host_ip, $host_port, $db_name); // // if (!$cubrid_con) { // echo "Database Connection Error"; // exit; // } // [/php] // [php] // $sql = "insert into olympic (host_year,host_nation,host_city," // . "opening_date,closing_date) values (2008, 'China', 'Beijing'," // . "to_date('08-08-2008','mm-dd- yyyy'),to_date('08-24-2008','mm-dd-yyyy')) ;"; // $result = cubrid_execute($cubrid_con, $sql); // if ($result) { // /** // * Handled successfully, so commit. // */ // cubrid_commit($cubrid_con); // echo "Inserted successfully "; // } else { // /** // * Error occurred, so the error message is output and rollback is called. // */ // echo cubrid_error_msg(); // cubrid_rollback($cubrid_con); // } // cubrid_disconnect($cubrid_con); // [/php] // // // [/code] // [/example] // // LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/cubrid.examples.php // EXAMPLES - END // // CUBRID_FUNCTIONS - BEGIN // CUBRID Functions // // Table of Contents // * cubrid_bind - Bind variables to a prepared statement as parameters // * cubrid_close_prepare - Close the request handle // * cubrid_close_request - Close the request handle // * cubrid_col_get - Get contents of collection type column using OID // * cubrid_col_size - Get the number of elements in collection type column using OID // * cubrid_column_names - Get the column names in result // * cubrid_column_types - Get column types in result // * cubrid_commit - Commit a transaction // * cubrid_connect_with_url - Establish the environment for connecting to CUBRID server // * cubrid_connect - Open a connection to a CUBRID Server // * cubrid_current_oid - Get OID of the current cursor location // * cubrid_disconnect - Close a database connection // * cubrid_drop - Delete an instance using OID // * cubrid_error_code_facility - Get the facility code of error // * cubrid_error_code - Get error code for the most recent function call // * cubrid_error_msg - Get last error message for the most recent function call // * cubrid_execute - Execute a prepared SQL statement // * cubrid_fetch - Fetch the next row from a result set // * cubrid_free_result - Free the memory occupied by the result data // * cubrid_get_autocommit - Get auto-commit mode of the connection // * cubrid_get_charset - Return the current CUBRID connection charset // * cubrid_get_class_name - Get the class name using OID // * cubrid_get_client_info - Return the client library version // * cubrid_get_db_parameter - Returns the CUBRID database parameters // * cubrid_get_query_timeout - Get the query timeout value of the request // * cubrid_get_server_info - Return the CUBRID server version // * cubrid_get - Get a column using OID // * cubrid_insert_id - Return the ID generated for the last updated AUTO_INCREMENT column // * cubrid_is_instance - Check whether the instance pointed by OID exists // * cubrid_lob_close - Close BLOB/CLOB data // * cubrid_lob_export - Export BLOB/CLOB data to file // * cubrid_lob_get - Get BLOB/CLOB data // * cubrid_lob_send - Read BLOB/CLOB data and send straight to browser // * cubrid_lob_size - Get BLOB/CLOB data size // * cubrid_lob2_bind - Bind a lob object or a string as a lob object to a prepared statement as parameters // * cubrid_lob2_close - Close LOB object // * cubrid_lob2_export - Export the lob object to a file // * cubrid_lob2_import - Import BLOB/CLOB data from a file // * cubrid_lob2_new - Create a lob object // * cubrid_lob2_read - Read from BLOB/CLOB data // * cubrid_lob2_seek64 - Move the cursor of a lob object // * cubrid_lob2_seek - Move the cursor of a lob object // * cubrid_lob2_size64 - Get a lob object's size // * cubrid_lob2_size - Get a lob object's size // * cubrid_lob2_tell64 - Tell the cursor position of the LOB object // * cubrid_lob2_tell - Tell the cursor position of the LOB object // * cubrid_lob2_write - Write to a lob object // * cubrid_lock_read - Set a read lock on the given OID // * cubrid_lock_write - Set a write lock on the given OID // * cubrid_move_cursor - Move the cursor in the result // * cubrid_next_result - Get result of next query when executing multiple SQL statements // * cubrid_num_cols - Return the number of columns in the result set // * cubrid_num_rows - Get the number of rows in the result set // * cubrid_pconnect_with_url - Open a persistent connection to CUBRID server // * cubrid_pconnect - Open a persistent connection to a CUBRID server // * cubrid_prepare - Prepare a SQL statement for execution // * cubrid_put - Update a column using OID // * cubrid_rollback - Roll back a transaction // * cubrid_schema - Get the requested schema information // * cubrid_seq_drop - Delete an element from sequence type column using OID // * cubrid_seq_insert - Insert an element to a sequence type column using OID // * cubrid_seq_put - Update the element value of sequence type column using OID // * cubrid_set_add - Insert a single element to set type column using OID // * cubrid_set_autocommit - Set autocommit mode of the connection // * cubrid_set_db_parameter - Sets the CUBRID database parameters // * cubrid_set_drop - Delete an element from set type column using OID // * cubrid_set_query_timeout - Set the timeout time of query execution // * cubrid_version - Get the CUBRID PHP module's version // // LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/ref.cubrid.php // CUBRID_FUNCTIONS - END // // CUBRID_MYSQL_COMPATIBILITY_FUNCTIONS - BEGIN // CUBRID MySQL Compatibility Functions // // Table of Contents // * cubrid_affected_rows - Return the number of rows affected by the last SQL statement // * cubrid_client_encoding - Return the current CUBRID connection charset // * cubrid_close - Close CUBRID connection // * cubrid_data_seek - Move the internal row pointer of the CUBRID result // * cubrid_db_name - Get db name from results of cubrid_list_dbs // * cubrid_errno - Return the numerical value of the error message from previous CUBRID operation // * cubrid_error - Get the error message // * cubrid_fetch_array - Fetch a result row as an associative array, a numeric array, or both // * cubrid_fetch_assoc - Return the associative array that corresponds to the fetched row // * cubrid_fetch_field - Get column information from a result and return as an object // * cubrid_fetch_lengths - Return an array with the lengths of the values of each field from the current row // * cubrid_fetch_object - Fetch the next row and return it as an object // * cubrid_fetch_row - Return a numerical array with the values of the current row // * cubrid_field_flags - Return a string with the flags of the given field offset // * cubrid_field_len - Get the maximum length of the specified field // * cubrid_field_name - Return the name of the specified field index // * cubrid_field_seek - Move the result set cursor to the specified field offset // * cubrid_field_table - Return the name of the table of the specified field // * cubrid_field_type - Return the type of the column corresponding to the given field offset // * cubrid_list_dbs - Return an array with the list of all existing CUBRID databases // * cubrid_num_fields - Return the number of columns in the result set // * cubrid_ping - Ping a server connection or reconnect if there is no connection // * cubrid_query - Send a CUBRID query // * cubrid_real_escape_string - Escape special characters in a string for use in an SQL statement // * cubrid_result - Return the value of a specific field in a specific row // * cubrid_unbuffered_query - Perform a query without fetching the results into memory // // LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/cubridmysql.cubrid.php // CUBRID_MYSQL_COMPATIBILITY_FUNCTIONS - END // // CUBRID_OBSOLETE_ALIASES_AND_FUNCTIONS - BEGIN // CUBRID Obsolete Aliases and Functions // // Table of Contents // * cubrid_load_from_glo - Read data from a GLO instance and save it in a file // * cubrid_new_glo - Create a glo instance // * cubrid_save_to_glo - Save requested file in a GLO instance // * cubrid_send_glo - Read data from glo and send it to std output // // LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/oldaliases.cubrid.php // CUBRID_OBSOLETE_ALIASES_AND_FUNCTIONS - END // // LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/book.cubrid.php // CUBRID - END // ============================== // ============================== BEGIN // PHP_DATABASE_VENDOR_CUBRID_CUBRID_BIND // ============================== PUBLIC // ============================== ABOUT // Bind variables to a prepared statement as parameters. // ============================== SUPPORT // PECL_CUBRID_8_3_0 // ============================== USING FUNCTIONS (1) // cubrid_bind() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // ============================== CODE function php_database_vendor_cubrid_cubrid_bind($req_identifier, $bind_index, $bind_value, $bind_value_type) { $return_cubrid_bind = false; // ========== CUBRID_BIND - BEGIN // ===== ABOUT // Bind variables to a prepared statement as parameters // ===== DESCRIPTION // The cubrid_bind() function is used to bind values to a corresponding named or question mark placeholder in the SQL statement that was passed to cubrid_prepare(). If bind_value_type is not given, string will be the default. // Note: If the type of data to be bound is BLOB/CLOB, CUBRID will try to map the data as a PHP stream. If the actually bind value type is not stream, CUBRID will convert it to string, and use it as the full path and file name of a file on the client filesystem. // If the type of data to be bound explicitly is ENUM, the bind_value argument should be the enum element which is in string format. // In CUBRID shard envrioment, the bind_value_type must be included in the cubrid_bind() function. // The following table shows the types of substitute values. // CUBRID Bind Date Types // Support | Bind Type | Corresponding SQL Type // Supported | STRING | CHAR, VARCHAR // | NCHAR | NCHAR, NVARCHAR // | BIT | BIT, VARBIT // | NUMERIC or NUMBER | SHORT, INT, NUMERIC // | FLOAT | FLOAT // | DOUBLE | DOUBLE // | TIME | TIME // | DATE | DATE // | TIMESTAMP | TIMESTAMP // | OBJECT | OBJECT // | ENUM | ENUM // | BLOB | BLOB // | CLOB | CLOB // | NULL | NULL // Not supported | SET | SET // | MULTISET | MULTISET // | SEQUENCE | SEQUENCE // ===== SUPPORTED // PECL_CUBRID >= PECL_CUBRID_8_3_0 // ===== SYNTAX // cubrid_bind( // resource $req_identifier, // int $bind_index, // mixed $bind_value, // string $bind_value_type = ? // ): bool // ===== CODE $return_cubrid_bind = cubrid_bind( $req_identifier, // resource req_identifier - Request identifier as a result of cubrid_prepare(). $bind_index, // int bind_index - Location of binding parameters. It starts with 1. $bind_value, // mixed bind_value - Actual value for binding. $bind_value_type // string bind_value_type - A type of the value to bind. (It is omitted by default. Thus, the system internally uses string by default. However, you need to specify the exact type of the value as an argument when they are NCHAR, BIT, or BLOB/CLOB). ); // Return Values // Returns true on success or false on failure. // // Changelog // Version - Description // 8.3.1 - Added BLOB/CLOB data types support. // // [examples] // Examples // [example] // Example #1 cubrid_bind() example // [php] // $conn = cubrid_connect("localhost", 33000, "demodb", "dba"); // // $result = cubrid_execute($conn, "SELECT code FROM event WHERE sports='Basketball' and gender='M'"); // $row = cubrid_fetch_array($result, CUBRID_ASSOC); // $event_code = $row["code"]; // // cubrid_close_request($result); // // $game_req = cubrid_prepare($conn, "SELECT athlete_code FROM game WHERE host_year=1992 and event_code=? and nation_code='USA'"); // cubrid_bind($game_req, 1, $event_code, "number"); // cubrid_execute($game_req); // // printf("--- Dream Team (1992 United States men's Olympic basketball team) ---\n"); // while ($athlete_code = cubrid_fetch_array($game_req, CUBRID_NUM)) { // $athlete_req = cubrid_prepare($conn, "SELECT name FROM athlete WHERE code=? AND nation_code='USA' AND event='Basketball' AND gender='M'"); // cubrid_bind($athlete_req, 1, $athlete_code[0], "number"); // cubrid_execute($athlete_req); // $row = cubrid_fetch_assoc($athlete_req); // printf("%s\n", $row["name"]); // } // // cubrid_close_request($game_req); // cubrid_close_request($athlete_req); // // cubrid_disconnect($conn); // [/php] // The above example will output: // [result] // --- Dream Team (1992 United States men's Olympic basketball team) --- // Stockton John // Robinson David // Pippen Scottie // Mullin C. // Malone Karl // Laettner C. // Jordan Michael // Johnson Earvin // Ewing Patrick // Drexler Clyde // Bird Larry // Barkley Charles // [/result] // [/example] // [example] // Example #2 cubrid_bind() BLOB/CLOB example // [php] // $con = cubrid_connect("localhost", 33000, "demodb", "dba", ""); // if ($con) { // cubrid_execute($con,"DROP TABLE if exists php_cubrid_lob_test"); // cubrid_execute($con,"CREATE TABLE php_cubrid_lob_test (doc_content CLOB)"); // $sql = "INSERT INTO php_cubrid_lob_test(doc_content) VALUES(?)"; // $req = cubrid_prepare($con, $sql); // // $fp = fopen("book.txt", "rb"); // // cubrid_bind($req, 1, $fp, "clob"); // cubrid_execute($req); // } // [/php] // [/example] // [example] // Example #3 cubrid_bind() BLOB/CLOB example // [php] // $con = cubrid_connect("localhost", 33000, "demodb", "dba", ""); // if ($con) { // cubrid_execute($con,"DROP TABLE if exists php_cubrid_lob_test"); // cubrid_execute($con,"CREATE TABLE php_cubrid_lob_test (image BLOB)"); // $sql = "INSERT INTO php_cubrid_lob_test(image) VALUES(?)"; // $req = cubrid_prepare($con, $sql); // // cubrid_bind($req, 1, "cubrid_logo.png", "blob"); // cubrid_execute($req); // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-16) // URL: https://www.php.net/manual/en/function.cubrid-bind.php // ========== CUBRID_BIND - END // SYNTAX: // bool cubrid_bind(resource $req_identifier, int $bind_index, mixed $bind_value, string $bind_value_type) return $return_cubrid_bind; // bool } // ============================== END // PHP_DATABASE_VENDOR_CUBRID_CUBRID_BIND // ============================== // ============================== BEGIN // PHP_DATABASE_VENDOR_CUBRID_CUBRID_CLOSE_PREPARE // ============================== PUBLIC // ============================== ABOUT // Close the request handle. // ============================== SUPPORT // PECL_CUBRID_8_3_0 // ============================== USING FUNCTIONS (1) // cubrid_close_prepare() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // ============================== CODE function php_database_vendor_cubrid_cubrid_close_prepare($req_identifier) { $return_cubrid_close_prepare = false; // ========== CUBRID_CLOSE_PREPARE - BEGIN // ===== ABOUT // Close the request handle // ===== DESCRIPTION // The cubrid_close_prepare() function closes the request handle given by the req_identifier argument, and releases the memory region related to the handle. It is an alias of cubrid_close_request(). // ===== SUPPORTED // PECL_CUBRID >= PECL_CUBRID_8_3_0 // ===== SYNTAX // cubrid_close_prepare(resource $req_identifier): bool // ===== CODE $return_cubrid_close_prepare = cubrid_close_prepare( $req_identifier // resource req_identifier - Request identifier. ); // Return Values // Return true on success. // // [examples] // Examples // [example] // Example #1 cubrid_close_prepare() example // [php] // $con = cubrid_connect ("localhost", 33000, "demodb", "dba", ""); // if ($con) { // echo "connected successfully"; // $req = cubrid_execute ( $con, "select * from members", // CUBRID_INCLUDE_OID | CUBRID_ASYNC); // if ($req) { // while ( list ($id, $name) = cubrid_fetch ($req) ){ // echo $id; // echo $name; // } // cubrid_close_prepare($req); // or you can use cubrid_close_request($req) // } // cubrid_disconnect($con); // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-16) // URL: https://www.php.net/manual/en/function.cubrid-close-prepare.php // ========== CUBRID_CLOSE_PREPARE - END // SYNTAX: // bool cubrid_close_prepare(resource $req_identifier) return $return_cubrid_close_prepare; // bool } // ============================== END // PHP_DATABASE_VENDOR_CUBRID_CUBRID_CLOSE_PREPARE // ============================== // ============================== BEGIN // PHP_DATABASE_VENDOR_CUBRID_CUBRID_CLOSE_REQUEST // ============================== PUBLIC // ============================== ABOUT // Close the request handle. // ============================== SUPPORT // PECL_CUBRID_8_3_0 // ============================== USING FUNCTIONS (1) // cubrid_close_request() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // ============================== CODE function php_database_vendor_cubrid_cubrid_close_request($req_identifier) { $return_cubrid_close_request = false; // ========== CUBRID_CLOSE_REQUEST - BEGIN // ===== ABOUT // Close the request handle // ===== DESCRIPTION // The cubrid_close_request() function closes the request handle given by the req_identifier argument, and releases the memory region related to the handle. It is an alias of cubrid_close_prepare(). // ===== SUPPORTED // PECL_CUBRID >= PECL_CUBRID_8_3_0 // ===== SYNTAX // cubrid_close_request(resource $req_identifier): bool // ===== CODE $return_cubrid_close_request = cubrid_close_request( $req_identifier // resource req_identifier - Request identifier. ); // Return Values // Return true on success. // // [examples] // Examples // [example] // Example #1 cubrid_close_request() example // [php] // $con = cubrid_connect ("localhost", 33000, "demodb", "dba", ""); // if ($con) { // echo "connected successfully"; // $req = cubrid_execute ( $con, "select * from members", // CUBRID_INCLUDE_OID | CUBRID_ASYNC); // if ($req) { // while ( list ($id, $name) = cubrid_fetch ($req) ){ // echo $id; // echo $name; // } // cubrid_close_request($req); // or you can use cubrid_close_prepare($req) // } // cubrid_disconnect($con); // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/function.cubrid-close-request.php // ========== CUBRID_CLOSE_REQUEST - END // SYNTAX: // bool cubrid_close_request(resource $req_identifier) return $return_cubrid_close_request; // bool } // ============================== END // PHP_DATABASE_VENDOR_CUBRID_CUBRID_CLOSE_REQUEST // ============================== // ============================== BEGIN // PHP_DATABASE_VENDOR_CUBRID_CUBRID_COL_GET // ============================== PUBLIC // ============================== ABOUT // Get contents of collection type column using OID. // ============================== SUPPORT // PECL_CUBRID_8_3_0 // ============================== USING FUNCTIONS (1) // cubrid_col_get() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // ============================== CODE function php_database_vendor_cubrid_cubrid_col_get($conn_identifier, $oid, $attr_name) { $return_cubrid_col_get = null; // ========== CUBRID_COL_GET - BEGIN // ===== ABOUT // Get contents of collection type column using OID // ===== DESCRIPTION // The cubrid_col_get() function is used to get contents of the elements of the collection type (set, multiset, sequence) attribute you requested as an array. // ===== SUPPORTED // PECL_CUBRID >= PECL_CUBRID_8_3_0 // ===== SYNTAX // cubrid_col_get(resource $conn_identifier, string $oid, string $attr_name): array // ===== CODE $return_cubrid_col_get = cubrid_col_get( $conn_identifier, // resource conn_identifier - Connection identifier. $oid, // string oid - OID of the instance that you want to read. $attr_name // string attr_name - Attribute name that you want to read from the instance. ); // Return Values // Array (0-based numerical array) containing the elements you requested, when process is successful; // false (to distinguish the error from the situation of attribute having empty collection or NULL, in case of error, a warning message is shown; in such case you can check the error by using cubrid_error_code()), when process is unsuccessful. // // [examples] // Examples // [example] // Example #1 cubrid_col_get() example // [php] // $conn = cubrid_connect("localhost", 33000, "demodb", "dba"); // // @cubrid_execute($conn, "DROP TABLE foo"); // cubrid_execute($conn, "CREATE TABLE foo(a int AUTO_INCREMENT, b set(int), c list(int), d char(10))"); // cubrid_execute($conn, "INSERT INTO foo(a, b, c, d) VALUES(1, {1,2,3}, {11,22,33,333}, 'a')"); // // $req = cubrid_execute($conn, "SELECT * FROM foo", CUBRID_INCLUDE_OID); // // cubrid_move_cursor($req, 1, CUBRID_CURSOR_FIRST); // $oid = cubrid_current_oid($req); // // $attr = cubrid_col_get($conn, $oid, "b"); // var_dump($attr); // // $size = cubrid_col_size($conn, $oid, "b"); // var_dump($size); // // cubrid_close_request($req); // cubrid_disconnect($conn); // [/php] // The above example will output: // [result] // array(3) { // [0]=> // string(1) "1" // [1]=> // string(1) "2" // [2]=> // string(1) "3" // } // int(3) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/function.cubrid-col-get.php // ========== CUBRID_COL_GET - END // SYNTAX: // array cubrid_col_get(resource $conn_identifier, string $oid, string $attr_name) return $return_cubrid_col_get; // array } // ============================== END // PHP_DATABASE_VENDOR_CUBRID_CUBRID_COL_GET // ============================== // ============================== BEGIN // PHP_DATABASE_VENDOR_CUBRID_CUBRID_COL_SIZE // ============================== PUBLIC // ============================== ABOUT // Get the number of elements in collection type column using OID. // ============================== SUPPORT // PECL_CUBRID_8_3_0 // ============================== USING FUNCTIONS (1) // cubrid_col_size() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // ============================== CODE function php_database_vendor_cubrid_cubrid_col_size($conn_identifier, $oid, $attr_name) { $return_cubrid_col_size = 0; // ========== CUBRID_COL_SIZE - BEGIN // ===== ABOUT // Get the number of elements in collection type column using OID // ===== DESCRIPTION // The cubrid_col_size() function is used to get the number of elements in a collection type (set, multiset, sequence) attribute. // ===== SUPPORTED // PECL_CUBRID >= PECL_CUBRID_8_3_0 // ===== SYNTAX // cubrid_col_size(resource $conn_identifier, string $oid, string $attr_name): int // ===== CODE $return_cubrid_col_size = cubrid_col_size( $conn_identifier, // resource conn_identifier - Connection identifier. $oid, // string oid - OID the instance that you want to work with. $attr_name // string attr_name - Name of the attribute that you want to work with. ); // Return Values // Number of elements, when process is successful, or false on failure. // // Changelog // Version - Description // 8.3.1 - Change return value: when process is unsuccessful, return false, not -1. // // [examples] // Examples // [example] // Example #1 cubrid_col_size() example // [php] // $conn = cubrid_connect("localhost", 33000, "demodb", "dba"); // // @cubrid_execute($conn, "DROP TABLE foo"); // cubrid_execute($conn, "CREATE TABLE foo(a int AUTO_INCREMENT, b set(int), c list(int), d char(10))"); // cubrid_execute($conn, "INSERT INTO foo(a, b, c, d) VALUES(1, {1,2,3}, {11,22,33,333}, 'a')"); // // $req = cubrid_execute($conn, "SELECT * FROM foo", CUBRID_INCLUDE_OID); // // cubrid_move_cursor($req, 1, CUBRID_CURSOR_FIRST); // $oid = cubrid_current_oid($req); // // $attr = cubrid_col_get($conn, $oid, "b"); // var_dump($attr); // // $size = cubrid_col_size($conn, $oid, "b"); // var_dump($size); // // cubrid_close_request($req); // cubrid_disconnect($conn); // [/php] // The above example will output: // [result] // array(3) { // [0]=> // string(1) "1" // [1]=> // string(1) "2" // [2]=> // string(1) "3" // } // int(3) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/function.cubrid-col-size.php // ========== CUBRID_COL_SIZE - END // SYNTAX: // int cubrid_col_size(resource $conn_identifier, string $oid, string $attr_name) return $return_cubrid_col_size; // int } // ============================== END // PHP_DATABASE_VENDOR_CUBRID_CUBRID_COL_SIZE // ============================== // ============================== BEGIN // PHP_DATABASE_VENDOR_CUBRID_CUBRID_COLUMN_NAMES // ============================== PUBLIC // ============================== ABOUT // Get the column names in result. // ============================== SUPPORT // PECL_CUBRID_8_3_0 // ============================== USING FUNCTIONS (1) // cubrid_column_names() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // ============================== CODE function php_database_vendor_cubrid_cubrid_column_names($req_identifier) { $return_cubrid_column_names = null; // ========== CUBRID_COLUMN_NAMES - BEGIN // ===== ABOUT // Get the column names in result // ===== DESCRIPTION // The cubrid_column_names() function is used to get the column names of the query result by using req_identifier. // ===== SUPPORTED // PECL_CUBRID >= PECL_CUBRID_8_3_0 // ===== SYNTAX // cubrid_column_names(resource $req_identifier): array // ===== CODE $return_cubrid_column_names = cubrid_column_names( $req_identifier // resource req_identifier - Request identifier. ); // Return Values // Array of string values containing the column names, when process is successful, or false on failure. // // [examples] // Examples // [example] // Example #1 cubrid_column_names() example // [php] // $conn = cubrid_connect("localhost", 33000, "demodb", "dba"); // $result = cubrid_execute($conn, "SELECT * FROM game WHERE host_year=2004 AND nation_code='AUS' AND medal='G'"); // // $column_names = cubrid_column_names($result); // $column_types = cubrid_column_types($result); // // printf("%-30s %-30s %-15s\n", "Column Names", "Column Types", "Column Maxlen"); // for($i = 0, $size = count($column_names); $i < $size; $i++) { // $column_len = cubrid_field_len($result, $i); // printf("%-30s %-30s %-15s\n", $column_names[$i], $column_types[$i], $column_len); // } // // cubrid_disconnect($conn); // [/php] // The above example will output: // [result] // Column Names Column Types Column Maxlen // host_year integer 11 // event_code integer 11 // athlete_code integer 11 // stadium_code integer 11 // nation_code char 3 // medal char 1 // game_date date 10 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/function.cubrid-column-names.php // ========== CUBRID_COLUMN_NAMES - END // SYNTAX: // array cubrid_column_names(resource $req_identifier) return $return_cubrid_column_names; // array } // ============================== END // PHP_DATABASE_VENDOR_CUBRID_CUBRID_COLUMN_NAMES // ============================== // ============================== BEGIN // PHP_DATABASE_VENDOR_CUBRID_CUBRID_COLUMN_TYPES // ============================== PUBLIC // ============================== ABOUT // Get column types in result. // ============================== SUPPORT // PECL_CUBRID_8_3_0 // ============================== USING FUNCTIONS (1) // cubrid_column_types() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // ============================== CODE function php_database_vendor_cubrid_cubrid_column_types($req_identifier) { $return_cubrid_column_types = null; // ========== CUBRID_COLUMN_TYPES - BEGIN // ===== ABOUT // Get column types in result // ===== DESCRIPTION // The cubrid_column_types() function gets column types of query results by using req_identifier. // ===== SUPPORTED // PECL_CUBRID >= PECL_CUBRID_8_3_0 // ===== SYNTAX // cubrid_column_types(resource $req_identifier): array // ===== CODE $return_cubrid_column_types = cubrid_column_types( $req_identifier // resource req_identifier - Request identifier. ); // Return Values // Array of string values containing the column types, when process is successful, or false on failure. // // [examples] // Examples // [example] // Example #1 cubrid_column_types() example // [php] // $conn = cubrid_connect("localhost", 33000, "demodb", "dba"); // $result = cubrid_execute($conn, "SELECT * FROM game WHERE host_year=2004 AND nation_code='AUS' AND medal='G'"); // // $column_names = cubrid_column_names($result); // $column_types = cubrid_column_types($result); // // printf("%-30s %-30s %-15s\n", "Column Names", "Column Types", "Column Maxlen"); // for($i = 0, $size = count($column_names); $i < $size; $i++) { // $column_len = cubrid_field_len($result, $i); // printf("%-30s %-30s %-15s\n", $column_names[$i], $column_types[$i], $column_len); // } // // cubrid_disconnect($conn); // [/php] // The above example will output: // [result] // Column Names Column Types Column Maxlen // host_year integer 11 // event_code integer 11 // athlete_code integer 11 // stadium_code integer 11 // nation_code char 3 // medal char 1 // game_date date 10 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-17) // URL: https://www.php.net/manual/en/function.cubrid-column-types.php // ========== CUBRID_COLUMN_TYPES - END // SYNTAX: // array cubrid_column_types(resource $req_identifier) return $return_cubrid_column_types; // array } // ============================== END // PHP_DATABASE_VENDOR_CUBRID_CUBRID_COLUMN_TYPES // ============================== // ============================== BEGIN // PHP_DATABASE_VENDOR_CUBRID_CUBRID_COMMIT // ============================== PUBLIC // ============================== ABOUT // Commit a transaction. // ============================== SUPPORT // PECL_CUBRID_8_3_0 // ============================== USING FUNCTIONS (1) // cubrid_commit() - PECL_CUBRID >= PECL_CUBRID_8_3_0 // ============================== CODE function php_database_vendor_cubrid_cubrid_commit($conn_identifier) { $return_cubrid_commit = false; // ========== CUBRID_COMMIT - BEGIN // ===== ABOUT // Commit a transaction // ===== DESCRIPTION // The cubrid_commit() function is used to execute commit on the transaction pointed by conn_identifier, currently in progress. Connection to the server is closed after the cubrid_commit() function is called; However, the connection handle is still valid. // In CUBRID PHP, auto-commit mode is disabled by default for transaction management. You can set it by using cubrid_set_autocommit(). You can get its status by using cubrid_get_autocommit(). Before you start a transaction, remember to disable the auto-commit mode. // ===== SUPPORTED // PECL_CUBRID >= PECL_CUBRID_8_3_0 // ===== SYNTAX // cubrid_commit(resource $conn_identifier): bool // ===== CODE $return_cubrid_commit = cubrid_commit( $conn_identifier // resource conn_identifier - Connection identifier. ); // Return Values // Returns true on success or false on failure. // // [examples] // Examples // [example] // Example #1 cubrid_commit() example // [php] // $conn = cubrid_connect("localhost", 33000, "demodb", "dba"// ); // // @cubrid_execute($conn, "DROP TABLE publishers"); // // $sql = <<= PECL_CUBRID_8_3_1 // ============================== CODE function php_database_vendor_cubrid_cubrid_connect_with_url($conn_url, $userid, $passwd, $new_link = false) { $return_cubrid_connect_with_url = null; // ========== CUBRID_CONNECT_WITH_URL - BEGIN // ===== ABOUT // Establish the environment for connecting to CUBRID server // ===== DESCRIPTION // The cubrid_connect_with_url() function is used to establish the environment for connecting to your server by using connection information passed with an url string argument. If the HA feature is enabled in CUBRID, you must specify the connection information of the standby server, which is used for failover when failure occurs, in the url string argument of this function. If the user name and password is not given, then the "PUBLIC" connection will be made by default. // ::= CUBRID:::::[?] // ::= [&] // ::= alhosts=[ &rctime=