27.7.6 C API Function Descriptions

27.7.6.1 mysql_affected_rows()
27.7.6.2 mysql_autocommit()
27.7.6.3 mysql_change_user()
27.7.6.4 mysql_character_set_name()
27.7.6.5 mysql_close()
27.7.6.6 mysql_commit()
27.7.6.7 mysql_connect()
27.7.6.8 mysql_create_db()
27.7.6.9 mysql_data_seek()
27.7.6.10 mysql_debug()
27.7.6.11 mysql_drop_db()
27.7.6.12 mysql_dump_debug_info()
27.7.6.13 mysql_eof()
27.7.6.14 mysql_errno()
27.7.6.15 mysql_error()
27.7.6.16 mysql_escape_string()
27.7.6.17 mysql_fetch_field()
27.7.6.18 mysql_fetch_field_direct()
27.7.6.19 mysql_fetch_fields()
27.7.6.20 mysql_fetch_lengths()
27.7.6.21 mysql_fetch_row()
27.7.6.22 mysql_field_count()
27.7.6.23 mysql_field_seek()
27.7.6.24 mysql_field_tell()
27.7.6.25 mysql_free_result()
27.7.6.26 mysql_get_character_set_info()
27.7.6.27 mysql_get_client_info()
27.7.6.28 mysql_get_client_version()
27.7.6.29 mysql_get_host_info()
27.7.6.30 mysql_get_option()
27.7.6.31 mysql_get_proto_info()
27.7.6.32 mysql_get_server_info()
27.7.6.33 mysql_get_server_version()
27.7.6.34 mysql_get_ssl_cipher()
27.7.6.35 mysql_hex_string()
27.7.6.36 mysql_info()
27.7.6.37 mysql_init()
27.7.6.38 mysql_insert_id()
27.7.6.39 mysql_kill()
27.7.6.40 mysql_library_end()
27.7.6.41 mysql_library_init()
27.7.6.42 mysql_list_dbs()
27.7.6.43 mysql_list_fields()
27.7.6.44 mysql_list_processes()
27.7.6.45 mysql_list_tables()
27.7.6.46 mysql_more_results()
27.7.6.47 mysql_next_result()
27.7.6.48 mysql_num_fields()
27.7.6.49 mysql_num_rows()
27.7.6.50 mysql_options()
27.7.6.51 mysql_options4()
27.7.6.52 mysql_ping()
27.7.6.53 mysql_query()
27.7.6.54 mysql_real_connect()
27.7.6.55 mysql_real_escape_string()
27.7.6.56 mysql_real_escape_string_quote()
27.7.6.57 mysql_real_query()
27.7.6.58 mysql_refresh()
27.7.6.59 mysql_reload()
27.7.6.60 mysql_reset_connection()
27.7.6.61 mysql_rollback()
27.7.6.62 mysql_row_seek()
27.7.6.63 mysql_row_tell()
27.7.6.64 mysql_select_db()
27.7.6.65 mysql_session_track_get_first()
27.7.6.66 mysql_session_track_get_next()
27.7.6.67 mysql_set_character_set()
27.7.6.68 mysql_set_local_infile_default()
27.7.6.69 mysql_set_local_infile_handler()
27.7.6.70 mysql_set_server_option()
27.7.6.71 mysql_shutdown()
27.7.6.72 mysql_sqlstate()
27.7.6.73 mysql_ssl_set()
27.7.6.74 mysql_stat()
27.7.6.75 mysql_store_result()
27.7.6.76 mysql_thread_id()
27.7.6.77 mysql_use_result()
27.7.6.78 mysql_warning_count()

This section describes C API functions other than those used for prepared statements or the replication stream interface. For information about those, see Section 27.7.10, “C API Prepared Statement Function Descriptions”, and C API Binary Log Function Descriptions .

In the descriptions here, a parameter or return value of NULL means NULL in the sense of the C programming language, not a MySQL NULL value.

Functions that return a value generally return a pointer or an integer. Unless specified otherwise, functions returning a pointer return a non-NULL value to indicate success or a NULL value to indicate an error, and functions returning an integer return zero to indicate success or nonzero to indicate an error. Note that nonzero means just that. Unless the function description says otherwise, do not test against a value other than zero:

if (result)                   /* correct */
    ... error ...

if (result < 0)               /* incorrect */
    ... error ...

if (result == -1)             /* incorrect */
    ... error ...

When a function returns an error, the Errors subsection of the function description lists the possible types of errors. You can find out which of these occurred by calling mysql_errno(). A string representation of the error may be obtained by calling mysql_error().