Documentation Home
MySQL 9.0 C API Developer Guide
Download this Manual
PDF (US Ltr) - 1.4Mb
PDF (A4) - 1.4Mb


MySQL 9.0 C API Developer Guide  /  C API Basic Interface  /  C API Basic Function Descriptions

5.4 C API Basic Function Descriptions

5.4.1 mysql_affected_rows()
5.4.2 mysql_autocommit()
5.4.3 mysql_bind_param()
5.4.4 mysql_change_user()
5.4.5 mysql_character_set_name()
5.4.6 mysql_close()
5.4.7 mysql_commit()
5.4.8 mysql_connect()
5.4.9 mysql_create_db()
5.4.10 mysql_data_seek()
5.4.11 mysql_debug()
5.4.12 mysql_drop_db()
5.4.13 mysql_dump_debug_info()
5.4.14 mysql_eof()
5.4.15 mysql_errno()
5.4.16 mysql_error()
5.4.17 mysql_escape_string()
5.4.18 mysql_fetch_field()
5.4.19 mysql_fetch_field_direct()
5.4.20 mysql_fetch_fields()
5.4.21 mysql_fetch_lengths()
5.4.22 mysql_fetch_row()
5.4.23 mysql_field_count()
5.4.24 mysql_field_seek()
5.4.25 mysql_field_tell()
5.4.26 mysql_free_result()
5.4.27 mysql_free_ssl_session_data()
5.4.28 mysql_get_character_set_info()
5.4.29 mysql_get_client_info()
5.4.30 mysql_get_client_version()
5.4.31 mysql_get_host_info()
5.4.32 mysql_get_option()
5.4.33 mysql_get_proto_info()
5.4.34 mysql_get_server_info()
5.4.35 mysql_get_server_version()
5.4.36 mysql_get_ssl_cipher()
5.4.37 mysql_get_ssl_session_data()
5.4.38 mysql_get_ssl_session_reused()
5.4.39 mysql_hex_string()
5.4.40 mysql_info()
5.4.41 mysql_init()
5.4.42 mysql_insert_id()
5.4.43 mysql_kill()
5.4.44 mysql_library_end()
5.4.45 mysql_library_init()
5.4.46 mysql_list_dbs()
5.4.47 mysql_list_fields()
5.4.48 mysql_list_processes()
5.4.49 mysql_list_tables()
5.4.50 mysql_more_results()
5.4.51 mysql_next_result()
5.4.52 mysql_num_fields()
5.4.53 mysql_num_rows()
5.4.54 mysql_options()
5.4.55 mysql_options4()
5.4.56 mysql_ping()
5.4.57 mysql_query()
5.4.58 mysql_real_connect()
5.4.59 mysql_real_connect_dns_srv()
5.4.60 mysql_real_escape_string()
5.4.61 mysql_real_escape_string_quote()
5.4.62 mysql_real_query()
5.4.63 mysql_refresh()
5.4.64 mysql_reload()
5.4.65 mysql_reset_connection()
5.4.66 mysql_reset_server_public_key()
5.4.67 mysql_result_metadata()
5.4.68 mysql_rollback()
5.4.69 mysql_row_seek()
5.4.70 mysql_row_tell()
5.4.71 mysql_select_db()
5.4.72 mysql_server_end()
5.4.73 mysql_server_init()
5.4.74 mysql_session_track_get_first()
5.4.75 mysql_session_track_get_next()
5.4.76 mysql_set_character_set()
5.4.77 mysql_set_local_infile_default()
5.4.78 mysql_set_local_infile_handler()
5.4.79 mysql_set_server_option()
5.4.80 mysql_shutdown()
5.4.81 mysql_sqlstate()
5.4.82 mysql_ssl_set()
5.4.83 mysql_stat()
5.4.84 mysql_store_result()
5.4.85 mysql_thread_id()
5.4.86 mysql_use_result()
5.4.87 mysql_warning_count()

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

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().