mysqli学习笔记
时间:2006-07-27 来源:cnscn2008
.取得查询结果对像类的方法
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
(
)
相关阅读 更多 +