Sorting code for pdo structure

不言
Release: 2023-04-03 07:38:01
Original
1347 people have browsed it

This article mainly introduces the code for sorting out the pdo structure. It has a certain reference value. Now I share it with you. Friends in need can refer to it.

typedef struct {
    pdo_mysql_db_handle     *H;
    MYSQL_RES               *result;
    const MYSQL_FIELD       *fields;
    MYSQL_ROW               current_data;
#if PDO_USE_MYSQLND
    const size_t            *current_lengths;
#else
    zend_long               *current_lengths;
#endif
    pdo_mysql_error_info    einfo;
#if PDO_USE_MYSQLND
    MYSQLND_STMT            *stmt; //st_mysqlnd_stmt
#else
    MYSQL_STMT              *stmt;
#endif
    int                     num_params;
    PDO_MYSQL_PARAM_BIND    *params;
#ifndef PDO_USE_MYSQLND
    my_bool                 *in_null;
    zend_ulong          *in_length;
#endif
    PDO_MYSQL_PARAM_BIND    *bound_result;
    my_bool                 *out_null;
    zend_ulong              *out_length;
    unsigned int            params_given;
    unsigned                max_length:1;
} pdo_mysql_stmt;
 
struct st_mysqlnd_stmt
{
    MYSQLND_STMT_DATA * data;///st_mysqlnd_stmt_data
    MYSQLND_CLASS_METHODS_TYPE(mysqlnd_stmt) * m;
    zend_bool persistent;
};
struct st_mysqlnd_res
{
    MYSQLND_CONN_DATA       *conn;
    enum_mysqlnd_res_type   type;
    unsigned int            field_count;

    /* For metadata functions */
    MYSQLND_RES_METADATA    *meta;

    /* To be used with store_result() - both normal and PS */
    MYSQLND_RES_BUFFERED    *stored_data;
    MYSQLND_RES_UNBUFFERED  *unbuf;

    zend_bool               persistent;
    MYSQLND_CLASS_METHODS_TYPE(mysqlnd_res) m;
};
struct st_mysqlnd_stmt_data
{
    MYSQLND_CONN_DATA           *conn;
   
    MYSQLND_RES                 *result;
    unsigned int                field_count;
    unsigned int                param_count;
  
    MYSQLND_CMD_BUFFER          execute_cmd_buffer;
    unsigned int                execute_count;/* count how many times the stmt was executed */
};
struct _pdo_stmt_t {
    /* driver specifics */
    struct pdo_stmt_methods *methods;
    void *driver_data;

    /* if true, we've already successfully executed this statement at least
     * once */
    unsigned executed:1;
    /* if true, the statement supports placeholders and can implement
     * bindParam() for its prepared statements, if false, PDO should
     * emulate prepare and bind on its behalf */
    unsigned supports_placeholders:2;

    unsigned _reserved:29;

    /* the number of columns in the result set; not valid until after
     * the statement has been executed at least once.  In some cases, might
     * not be valid until fetch (at the driver level) has been called at least once.
     * */
    int column_count;
    struct pdo_column_data *columns;
}
Copy after login

The above is the entire content of this article. I hope it will be helpful to everyone’s learning. For more related content, please pay attention to the PHP Chinese website!

Related recommendations:

PHP generates QR code for WeChat applet with parameters

About php-fpm Process number management

The above is the detailed content of Sorting code for pdo structure. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!