Two methods for connecting PHP to MYSQL

Source: Internet
Author: User
Tags mysql functions
Mysql can be connected to the web through PHP in two ways. One is through the mysql coherent function of php, and the other is through the ODBC coherent function of php as follows: MYSQL function mysql_affected_rows: obtain the number of columns affected by the final control of MySQL. Mysql_close: mysql can be connected to the web through PHP in two ways. one is the mysql coherence function in php, and the other is the ODBC coherence function in php.

Coherent functions are as follows:

MYSQL functions

Mysql_affected_rows: obtain the number of columns affected by MySQL's final control.
Mysql_close: Closes the MySQL server connection.
Mysql_connect: enables connections to the MySQL server.
Mysql_create_db: creates a new MySQL material Library.
Mysql_data_seek: move internal return indicator.
Mysql_db_query: Send the query string to the MySQL material Library.
Mysql_drop_db: remove the material Library.
Mysql_errno: return the error code.
Mysql_error: returns an error message.
Mysql_fetch_array: returns the array material.
Mysql_fetch_field: obtains the field information.
Mysql_fetch_lengths: returns the maximum length of each column in a single column.
Mysql_fetch_object: returns the object material.
Mysql_fetch_row: returns the columns of a single column.
Mysql_field_name: return the name of the specified field.
Mysql_field_seek: set a field from the indicator to the returned value.
Mysql_field_table: obtain the name of the table in the current column.
Mysql_field_type: obtain the current column type.
Mysql_field_flags: obtains the flag of the current field.
Mysql_field_len: get the length of the current column.
Mysql_free_result: memory occupied by the API.
Mysql_insert_id: return the ID of the last INSERT command applied.
Mysql_list_fields: lists the fields of a specified material table ).
Mysql_list_dbs: list the available material libraries (databases) of the MySQL server ).
Mysql_list_tables: lists the material tables of a specified volume ).
Mysql_num_fields: gets the number of returned fields.
Mysql_num_rows: gets the number of returned columns.
Mysql_pconnect: enables long-term connections to the MySQL server.
Mysql_query: returns a query string.
Mysql_result: obtain the query result.
Mysql_select_db: Select a material Library.
Mysql_tablename: get the name of the material table.
ODBC functions

To use ODBC functions, you must install MYSQL ODBC

Odbc_autocommit: switches the active and dynamic functions.
Odbc_binmode: sets the binary material processing method.
Odbc_close: Closes the ODBC link.
Odbc_close_all: Closes All ODBC connections.
Odbc_commit: change the ODBC material Library.
Odbc_connect: link to ODBC material Library.
Odbc_cursor: Get the cursor name.
Odbc_do: execute SQL commands.
Odbc_exec: executes SQL commands.
Odbc_execute: executes preset SQL commands.
Odbc_fetch_into: Gets the specified column returned.
Odbc_fetch_row: returns a column.
Odbc_field_name: obtains the column name.
Odbc_field_type: obtains the field material form.
Odbc_field_len: Gets the length of the column material.
Odbc_free_result: refers to the memory for returning the materials.
Odbc_longreadlen: sets the maximum value of the return column.
Odbc_num_fields: obtains the number of fields.
Odbc_pconnect: long-term connection to the ODBC material Library.
Odbc_prepare: preset SQL commands.
Odbc_num_rows: gets the number of returned columns.
Odbc_result: Gets the returned material.
Odbc_result_all: returns HTML table material.
Odbc_rollback: cancels the current transaction.
Odbc_setoption: Configure ODBC settings.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.