MySQL provides a number of functions to operate the database, broadly divided into the following categories:
The first part controls the class function
Mysql_init () initializing MySQL object
Mysql_options () Setting connection options
Mysql_real_connect () connect to MySQL Database
Mysql_real_escape_string () legalizing the query string
mysql_query () emits a query string that ends with a null character
Mysql_real_query () issue a query string
Mysql_store_result () One-time transfer results
Mysql_use_result () pass-by-line results
Mysql_free_result () Releasing the result set
Mysql_change_user () change user
mysql_select_db () Change the default database
Mysql_debug () Send debug information
Mysql_dump_debug_info () Dump debug information
Mysql_ping () test whether the database is active
Mysql_shutdown () Request database shutdown
Mysql_close () to close the database connection
The second part information gets the class function
Mysql_character_set_name () Gets the default character set
Mysql_get_client_info () Get client information
Mysql_host_info () Get host information
Mysql_get_proto_info () Get protocol information
Mysql_get_server_info () Get server information
Mysql_info () Get additional information for a partial query statement
Mysql_stat () Get Database status
Mysql_list_dbs () Get a list of databases
Mysql_list_tables () Get a list of data tables
Mysql_list_fields () Get the field list
The third Part column class operation function
Mysql_field_count () Gets the number of fields
Mysql_affected_rows () Gets the number of rows affected
MYSQL_INSERT_ID () Gets the ID value of the auto_increment column
Mysql_num_fields () Gets the number of fields in the result set
Mysql_field_tell () Gets the current field position
Mysql_field_seek () Position field
Mysql_fetch_field () Gets the current field
Mysql_fetch_field_direct () Gets the specified field
Mysql_frtch_fields () gets an array of all fields
Mysql_num_rows () Gets the number of rows
Mysql_fetch_lengths () Gets the line length
Mysql_row_tell () Gets the current row position
Mysql_row_seek () Row positioning
Mysql_data_seek () Row positioning
Mysql_fetch_row () Get the Forward
Part fourth Threading class operation function
Mysql_list_processes () returns the list of all threads
MYSQL_THREAD_ID () Gets the current thread ID
Mysql_thread_safe () Whether thread mode is supported
Mysql_kill () Kill a thread
Part five error handling class function
Mysql_errno () Get error number
Mysql_error () Get error message
Part six obsolete functions
Mysql_connect ()
mysql_create_db ()
mysql_drop_db ()
Mysql_eof ()
Mysql_reload ()
Mysql_escape_string ()
API interface with MySQL:
- Mysql_affected_rows () returns the number of rows affected by the latest update, delete, or insert query.
- Mysql_close () closes a server connection.
- Mysql_connect () connect a MySQL server. This function is not recommended; use Mysql_real_connect () instead.
- Mysql_change_user () Changes the user and database on an open connection.
- mysql_create_db () creates a database. The function is not recommended, and the SQL command is used to create DATABASE.
- Mysql_data_seek () Searches for an arbitrary row in a query result collection.
- Mysql_debug () makes a dbug_push with the given string.
- mysql_drop_db () discards a database. The function is not recommended, and the SQL command is used to drop DATABASE.
- Mysql_dump_debug_info () lets the server write debug information to the log file.
- Mysql_eof () determines whether the last row of a result collection has been read. This function is objected to; Mysql_errno () or mysql_error () can be used instead.
- Mysql_errno () returns the error number of the most recently called MySQL function.
- Mysql_error () returns an error message for the most recently called MySQL function.
- Mysql_escape_string () escapes special characters for strings that are used in SQL statements.
- Mysql_fetch_field () returns the type of the next table field.
- Mysql_fetch_field_direct () returns the type of a table field, giving a number of fields.
- Mysql_fetch_fields () returns an array of all the field structures.
- Mysql_fetch_lengths () returns the length of all columns in the current row.
- Mysql_fetch_row () Gets the next line from the result collection.
- Mysql_field_seek () Places the column cursor on a specified column.
- Mysql_field_count () returns the number of results columns for the most recent query.
- Mysql_field_tell () returns the position of the field cursor used for the last Mysql_fetch_field ().
- Mysql_free_result () frees the memory used by a result collection.
- Mysql_get_client_info () returns the customer version information.
- Mysql_get_host_info () returns a string that describes the connection.
- Mysql_get_proto_info () Returns the protocol version used by the connection.
- Mysql_get_server_info () returns the server version number.
- Mysql_info () returns information about the most recently executed query.
- Mysql_init () Gets or initializes a MySQL structure.
- MYSQL_INSERT_ID () returns the ID of the previous query that was generated for a auto_increment column.
- Mysql_kill () kills a given thread.
- Mysql_list_dbs () returns the name of the database that matches a simple regular expression.
- Mysql_list_fields () returns the name of a column that matches a simple regular expression.
- Mysql_list_processes () Returns a table for the current server thread.
- Mysql_list_tables () returns the name of the table that matches a simple regular expression.
- Mysql_num_fields () returns the number of columns that a result collection is heavy.
- Mysql_num_rows () returns the number of rows in a result set.
- Mysql_options () Sets the connection options for mysql_connect ().
- Mysql_ping () Check that the connection to the server is working and reconnect if necessary.
- Mysql_query () executes an SQL query that is specified as a null-terminated string.
- Mysql_real_connect () connect a MySQL server.
- Mysql_real_query () executes an SQL query that is specified as a string with a count.
- Mysql_reload () tells the server to reload the authorization table.
- Mysql_row_seek () Searches for a row in the result set, using the value returned from Mysql_row_tell ().
- Mysql_row_tell () returns the row cursor position.
- mysql_select_db () connects a database.
- Mysql_shutdown () Shut down the database server.
- Mysql_stat () returns the server state as a string.
- Mysql_store_result () Retrieves a complete set of results to the customer.
- MYSQL_THREAD_ID () returns the ID of the current thread.
- Mysql_use_result () Initializes a row of rows to retrieve the result collection.
MySQL API functions