MySQL is a small and flexible database server software. it is a fantasy for small and medium-sized exploitation systems. In addition to supporting the scale of ANSISQL statements, the most important thing is that it also supports multiple platforms, while on Unix/Linux systems, MySQL supports multi-thread operations.
MySQL is a small and flexible database server software. it is a fantasy for small and medium-sized exploitation systems. In addition to ansi SQL statements supporting the scale, MySQL also supports multiple platforms. on Unix/Linux systems, MySQL supports multithreading, in this way, we can obtain good performance. Like PHP and Apache, Apache is an open source software. Its official website is:Http://www.mysql.comWhich provides source code download for Windows, Linux, and Unix.
Note that MySQL functions require the appropriate permissions to run. Common coherent functions are described as follows:
(1) integer mysql_connect (host, user name, password );
This function starts a connection to the MySQL database on the specified host. If the database is on a different port, add the colon and port number after the host name. All parameters are optional. by default, the script name corresponding to the local host and being executed by the user is distinguished as null. The host can be an IP address or domain name.
When the script is executed, the connection is automatically closed, or you can use mysql_close to close the connection in advance.
(2) boolean mysql_create_db (database name );
Create a database. Note that you must use an account with the permission to create a database to open the connection.
(3) boolean mysql_select_db (database name, connection number );
Select the default database.
(4) integer mysql_query (SQL statement, connection number );
Queries a specified database. If the SQL statement is select, a result number is returned. Otherwise, the returned value can be ignored. If it fails, false is returned ..
(5) array mysql_fetch_array (result number );
Retrieves the next row and returns an array. You can use a number subscript to visit (the first field is subscript 0), or you can use a string subscript to visit (that is, the application of each field name ). If the last row is obtained, false is returned ..
(6) mysql_fetch_row (result number );
Returns a matrix representing all fields in a row in the result set. Each call will generate the next row, and false will be returned until there are no remaining rows. Each domain value is indexed by an offset starting from scratch. This is the fastest way to get results from queries.
(7) integer mysql_num_rows (result number );
Number of rows in the returned result set
(8) integer mysql_num_fields (result number );
Returns the number of fields in the result set.
(9) integer mysql_list_dbs ();
Query the database list on the server. It returns a result pointer, which can be used in the mysql_fetch_row function and similar functions.
(10) mysql_list_tables (database name );
Returns a result pointer to the list of tables pointing to the specified database. The result pointer can be used to retrieve rows from the result set.