Error prompt: Fatalerror: Calltoundefinedfunctionmysqli_num_row () the error prompt is shown in the title. I also found a circle on the Internet, which means that the php_mysqli module is not enabled, and my wampserver environment is enabled, however, I disabled it again and turned it on again. The results were the same. it was a strange thing that I failed to connect to the database on the Internet, but I did not prompt that the connection to the database failed, however, an error occurs when mysqli_num_row is used.
Next, I will first check the enabling status of mysqli under phpinfo.
Mysqli
MysqlI Support enabled
Client API library version mysqlnd 5.0.8-dev-20102224-$ Id: 65fe78e70ce53d27a6cd578597722950e490b0d0 $
Active Persistent Links 0
Inactive Persistent Links 0
Active Links 0
Directive Local Value Master Value
Mysqli. allow_local_infile On
Mysqli. allow_persistent On
Mysqli. default_host no value
Mysqli. default_port 3306 3306
Mysqli. default_pw no value
Mysqli. default_socket no value
Mysqli. default_user no value
Mysqli. max_links Unlimited
Mysqli. max_persistent Unlimited
Mysqli. reconnect Off
Below is my code section
MySQL Error :". mysqli_error ($ conn); if (mysqli_num_row ($ r) = 0) {// if the query verifies that the email address is not in use, then the registered user $ a = md5 (uniqid (rand (), true); // Create an activation code (create a string of exactly 32 characters) $ q = "insert into users (username, email, password, active, registration_date) VALUES ('$ n',' $ E', SHA1 ('$ P '), '$ A', NOW () "; $ r = mysqli_query ($ conn, $ q) or trigger_error (" Query: $ q \ n
MySQL Error :". mysqli_error ($ conn); if (mysqli_affected_rows ($ conn) = 1) {$ body = "thank you for your registration. to activate your account, click here: \ n "; $ body. = BASE_URL. 'activate. php? X = '. urlencode ($ e ). "& y = $ a"; mail ($ trimmed ['mail'], 'confirm registration', $ body, 'From: 414412984@qq.com '); echo' thank you for your registration! A confirmation email has been sent to your mailbox. Click the link in the email to activate your account. '; Exit ();} else {echo'User registration failed, so we are sorry, please register once
';}} Else {// The verified email address has been registered with echo'The email address has been registered.
';}} Else {foreach ($ errors as $ msg) {// Print each error. echo "-$ msg
\ N ";}} mysqli_close ($ conn) ;}?>Home> registration
Reply to discussion (solution)
print_r(get_extension_funcs('mysqli'));
Check whether there is any
Array
(
[0] => mysqli_affected_rows
[1] => mysqli_autocommit
[2] => mysqli_change_user
[3] => mysqli_character_set_name
[4] => mysqli_close
[5] => mysqli_commit
[6] => mysqli_connect
[7] => mysqli_connect_errno
[8] => mysqli_connect_error
[9] => mysqli_data_seek
[10] => mysqli_dump_debug_info
[11] => mysqli_debug
[12] => mysqli_errno
[13] => mysqli_error
[14] => mysqli_error_list
[15] => mysqli_stmt_execute
[16] => mysqli_execute
[17] => mysqli_fetch_field
[18] => mysqli_fetch_fields
[19] => mysqli_fetch_field_direct
[20] => mysqli_fetch_lengths
[21] => mysqli_fetch_all
[22] => mysqli_fetch_array
[23] => mysqli_fetch_assoc
[24] => mysqli_fetch_object
[25] => mysqli_fetch_row
[26] => mysqli_field_count
[27] => mysqli_field_seek
[28] => mysqli_field_tell
[29] => mysqli_free_result
[30] => mysqli_get_connection_stats
[31] => mysqli_get_client_stats
[32] => mysqli_get_charset
[33] => mysqli_get_client_info
[34] => mysqli_get_client_version
[35] => mysqli_get_host_info
[36] => mysqli_get_proto_info
[37] => mysqli_get_server_info
[38] => mysqli_get_server_version
[39] => mysqli_get_warnings
[40] => mysqli_init
[41] => mysqli_info
[42] => mysqli_insert_id
[43] => mysqli_kill
[44] => mysqli_more_results
[45] => mysqli_multi_query
[46] => mysqli_next_result
[47] => mysqli_num_fields
[48] => mysqli_num_rows. do you want this? But you wrote it wrong.
[49] => mysqli_options
[50] => mysqli_ping
[51] => mysqli_poll
[52] => mysqli_prepare
[53] => mysqli_report
[54] => mysqli_query
[55] => mysqli_real_connect
[56] => mysqli_real_escape_string
[57] => mysqli_real_query
[58] => mysqli_reap_async_query
[59] => mysqli_rollback
[60] => mysqli_select_db
[61] => mysqli_set_charset
[62] => mysqli_stmt_affected_rows
[63] => mysqli_stmt_attr_get
[64] => mysqli_stmt_attr_set
[65] => mysqli_stmt_bind_param
[66] => mysqli_stmt_bind_result
[67] => mysqli_stmt_close
[68] => mysqli_stmt_data_seek
[69] => mysqli_stmt_errno
[70] => mysqli_stmt_error
[71] => mysqli_stmt_error_list
[72] => mysqli_stmt_fetch
[73] => mysqli_stmt_field_count
[74] => mysqli_stmt_free_result
[75] => mysqli_stmt_get_result
[76] => mysqli_stmt_get_warnings
[77] => mysqli_stmt_init
[78] => mysqli_stmt_insert_id
[79] => mysqli_stmt_more_results
[80] => mysqli_stmt_next_result
[81] => mysqli_stmt_num_rows
[82] => mysqli_stmt_param_count
[83] => mysqli_stmt_prepare
[84] => mysqli_stmt_reset
[85] => mysqli_stmt_result_metadata
[86] => mysqli_stmt_send_long_data
[87] => mysqli_stmt_store_result
[88] => mysqli_stmt_sqlstate
[89] => mysqli_sqlstate
[90] => mysqli_ssl_set
[91] => mysqli_stat
[92] => mysqli_store_result
[93] => mysqli_thread_id
[94] => mysqli_thread_safe
[95] => mysqli_use_result
[96] => mysqli_warning_count
[97] => mysqli_refresh
[98] => mysqli_escape_string
[99] => mysqli_set_opt
)
It's just as careless as you said. the method you provided is intuitive. thank you.