Building Chinese Web Sites using PHP
∟MySQL - Connecting PHP to Database
∟Commonly Used MySQL Functions
This section provides a list of commonly used MySQL functions.
Once MySQL module, php_mysql.dll, is loaded into PHP, it offers a large number functions
to help you to access MySQL servers and perform database related tasks.
Some commonly used MySQL functions are:
- mysql_connect - Open a connection to a MySQL Server
- mysql_select_db - Select a MySQL database
- mysql_close - Close MySQL connection
- mysql_query - Send a MySQL query to the current database
- mysql_affected_rows - Get number of affected rows in previous MySQL operation
- mysql_client_encoding - Returns the name of the character set
- mysql_errno - Returns the numerical value of the error message from previous MySQL operation
- mysql_error - Returns the text of the error message from previous MySQL operation
- mysql_fetch_array - Fetch a result row as an associative array, a numeric array, or both
- mysql_fetch_lengths - Get the length of each output in a result
- mysql_fetch_object - Fetch a result row as an object
- mysql_fetch_row - Get a result row as an enumerated array
- mysql_free_result - Free result memory
- mysql_field_len - Returns the length of the specified field
- mysql_field_name - Get the name of the specified field in a result
- mysql_field_table - Get name of the table the specified field is in
- mysql_field_type - Get the type of the specified field in a result
- mysql_info - Get information about the most recent query
- mysql_insert_id - Get the ID generated from the previous INSERT operation
- mysql_num_fields - Get number of fields in result
- mysql_num_rows - Get number of rows in result
- mysql_field_seek - Set result pointer to a specified field offset
- mysql_fetch_field - Get column information from a result and return as an object
- mysql_result - Get result data
Last update: 2015.
Table of Contents
About This Book
PHP Installation on Windows Systems
Integrating PHP with Apache Web Server
charset="*" - Encodings on Chinese Web Pages
Chinese Characters in PHP String Literals
Multibyte String Functions in UTF-8 Encoding
Input Text Data from Web Forms
Input Chinese Text Data from Web Forms
MySQL - Installation on Windows
►MySQL - Connecting PHP to Database
php_mysql.dll - Configuring PHP to Use MySQL Module
►Commonly Used MySQL Functions
mysql_connect() - Creating MySQL Connections
INSERT INTO - Inserting New Records
SELECT - Running Database Queries
UPDATE - Modifying Database Records
MySQL - Character Set and Encoding
MySQL - Sending Non-ASCII Text to MySQL
Retrieving Chinese Text from Database to Web Pages
Input Chinese Text Data to MySQL Database
References
PDF Printing Version