免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 885 | 回复: 0
打印 上一主题 下一主题

mysqli学习笔记 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-07-27 15:04 |只看该作者 |倒序浏览

               
               
               
               
               
                .取得查询结果对像类的方法
query("select * from parent ");
     
     print_r(get_class_methods(get_class($objClassDB5)));//取得类的方法
     print_r(get_class_methods(get_class($objQuery))); //取得类的方法
     print_r(get_class_vars(get_class($objQuery)));    //取得类的属性
     print_r(get_object_vars($objQuery));              //取得对象的属性
?>
[root@localhost html]# php classDB5.inc.php
//get_class_methods(get_class($objClassDB5))
Array
(
    [0] =>  autocommit
    [1] =>  change_user
    [2] =>  character_set_name
    [3] =>  client_encoding
    [4] =>  close
    [5] =>  commit
    [6] =>  connect
    [7] =>  debug
    [8] =>  disable_reads_from_master
    [9] =>  disable_rpl_parse
    [10] => dump_debug_info
    [11] => enable_reads_from_master
    [12] => enable_rpl_parse
    [13] => get_charset
    [14] => get_client_info
    [15] => get_server_info
    [16] => get_warnings
    [17] => init
    [18] => kill
    [19] => set_local_infile_default
    [20] => set_local_infile_handler
    [21] => master_query
    [22] => multi_query
    [23] => mysqli
    [24] => more_results
    [25] => next_result
    [26] => options
    [27] => ping
    [28] => prepare
    [29] => query
    [30] => real_connect
    [31] => real_escape_string
    [32] => escape_string
    [33] => real_query
    [34] => rollback
    [35] => rpl_parse_enabled
    [36] => rpl_probe
    [37] => rpl_query_type
    [38] => select_db
    [39] => set_charset
    [40] => set_opt
    [41] => slave_query
    [42] => ssl_set
    [43] => stat
    [44] => stmt_init
    [45] => store_result
    [46] => thread_safe
    [47] => use_result
)
属性:
affected_rows
   -  gets the number of affected rows in a previous MySQL operation
client_info
     - returns the MySQL client version as a string
client_version
  - returns the MySQL client version as an integer
errno
           - returns the error code for the most recent function call
error
           - returns the error string for the most recent function call
field_count
     - returns the number of columns for the most recent query
host_info
       - returns a string representing the type of connection used
info
            - retrieves information about the most recently executed query
insert_id
       - returns the auto generated id used in the last query
protocol_version
- returns the version of the MySQL protocol used
sqlstate
        - returns a string containing the SQLSTATE error code for the last error
thread_id
       - returns the thread ID for the current connection
warning_count
   - returns the number of warnings generated during execution of the previous SQL statement
//get_class_methods(get_class($objQuery))
Array
(
    [0] =>  mysqli_result
    [1] =>  close
    [2] =>  free
    [3] =>  data_seek
    [4] =>  fetch_field
    [5] =>  fetch_fields
    [6] =>  fetch_field_direct
    [7] =>  fetch_array
    [8] =>  fetch_assoc
    [9] =>  fetch_object
    [10] => fetch_row
    [11] => field_count
    [12] => field_seek
    [13] => free_result
)
//$objQuery属性
  num_rows --
     Gets the number of rows in a result
//get_class_vars(get_class($objQuery))
Array
(
)
//get_object_vars($objQuery)
Array
(
)
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/13329/showart_146522.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP