pdo_dbh_t definition pdo_dbh_t

pdo_dbh_t definition

All fields should be treated as read-only by the driver, unless explicitly stated otherwise.

struct _pdo_dbh_t{struct pdo_dbh_methods *methods;
*
void *driver_data;
**
char *username, *password;
***
unsigned is_persistent:1;
****
unsigned auto_commit:1;
*****
unsigned alloc_own_columns:1;
******
unsigned in_txn:1;  unsigned max_escaped_char_length:3;
*******
const char *data_source;
********
unsigned long data_source_len;  pdo_error_type error_code;
*********
enum pdo_case_conversion native_case
**********
, desired_case;};

淘宝 adsense 商品推荐

官方正版 Google AdSense实战宝典 用谷歌广告联盟出海赚美元 第2版 祁劲松 网站运营书籍 seo搜索引擎优化 AdSense从入门到精通

价格:37元

*

The drivermustset this duringSKEL_handle_factory().

**

This item is for use by the driver; the intended usage is to store a pointer(duringSKEL_handle_factory())to whatever instance data is required to maintain a connection to the database.

***

The username and password that were passed into the PDO constructor. The driver should use these values when it initiates a connection to the database.

****

If this is set to 1, then any data that is referenced by the dbh, including whatever structure your driver allocates,MUSTbe allocated persistently. This is easy to achieve; rather than using the usualemalloc()simply usepemalloc()and pass the value of this flag as the last parameter. Failure to use the appropriate kind of memory can lead to serious memory faults, resulting(in the best case)a hard crash, and in the worst case, an exploitable memory problem.

If, for whatever reason, your driver is not suitable to run persistently, youMUSTcheck this flag in yourSKEL_handle_factory()and raise an appropriate error.

*****

You should check this value in yourSKEL_handle_doer()andSKEL_stmt_execute()functions; if it evaluates to true, you must attempt to commit the query now. Most database implementations offer an auto-commit mode that handles this automatically.

******

If your database client library API operates by fetching data into a caller-supplied buffer, you should set this flag to 1 during yourSKEL_handle_factory(). When set, PDO will call yourSKEL_stmt_describer()earlier than it would otherwise. This early call allows you to determine those buffer sizes and issue appropriate calls to the database client library.

If your database client library API simply returns pointers to its own internal buffers for you to copy after each fetch call, you should leave this value set to 0.

*******

If your driver doesn't support native prepared statements(supports_placeholdersis set toPDO_PLACEHOLDER_NONE), you must set this value to the maximum length that can be taken up by a single character when it is quoted by yourSKEL_handle_quoter()function. This value is used to calculate the amount of buffer space required when PDO executes the statement.

********

This holds the value of the DSN that was passed into the PDO constructor. If your driver implementation needed to modify the DSN for whatever reason, it should update this member duringSKEL_handle_factory(). Modifying this member should be avoided. If you do change it, you must ensure thatdata_source_lenis also correct.

*********

Whenever an error occurs during a call to one of your driver methods, you should set this member to the SQLSTATE code that best describes the error and return an error. In this HOW-TO, the suggested practice is to callSKEL_handle_error()when an error is detected, and have it set the error code.

**********

Your driver should set this duringSKEL_handle_factory(); the value should reflect how the database returns the names of the columns in result sets. If the name matches the case that was used in the query, set it toPDO_CASE_NATURAL(this is actually the default). If the column names are always returned in upper case, set it toPDO_CASE_UPPER. If the column names are always returned in lower case, set it toPDO_CASE_LOWER. The value you set is used to determine if PDO should perform case folding when the user sets thePDO_ATTR_CASEattribute.

淘宝 云主机 商品推荐

远程电脑出租e5主机云服务器物理机游戏云主机工作室服务器租用

价格:12元