首页 > 后端开发 > php教程 > 对于pdo结构体的梳理代码

对于pdo结构体的梳理代码

不言
发布: 2023-04-03 07:38:01
原创
1505 人浏览过

这篇文章主要介绍了关于对pdo结构体的梳理代码,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

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;

}

登录后复制

以上就是本文的全部内容,希望对大家的学习有所帮助,更多相关内容请关注PHP中文网!

相关推荐:

  PHP生成带参数的微信小程序的二维码

关于php-fpm的进程数管理

以上是对于pdo结构体的梳理代码的详细内容。更多信息请关注PHP中文网其他相关文章!

相关标签:
php
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
作者最新文章
最新问题
怎么学好php
来自于 1970-01-01 08:00:00
0
0
0
PHP扩展intl
来自于 1970-01-01 08:00:00
0
0
0
php数据获取?
来自于 1970-01-01 08:00:00
0
0
0
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板