MySQL has a unique function called MySQL array function. The following describes the MySQL Array Function-mysql_fetch_array ().
Mysql_fetch_array gets a row from the result set as an associated array, a number array, or both.
Calling this function in turn also returns the next row of the result set.
MySQL Array Function Syntax: mysql_fetch_array (resource result, result type)
The returned results are generally:
Array ([0] => 1 [ID] => 1 [1] => 58.215.76.161 [IP] => 58.215.76.161 [2] => linux [description] => linux [3] => 1 [4] => http [protocol] => http [5] => 80 [port] => 80 [6] => http [7] => check_http [command] => check_http)
If you only need to associate the array, the command parameter is
Mysql_fetch_array ($ rs, MYSQL_ASSOC) is equivalent to the function mysql_fetch_assoc ().
The returned result is
Array ([ID] => 1 [IP] => 58.215.76.161 [description] => linux [protocol] => http [port] => 80 [command] => check_http)
If you only need a number array, the command parameter is
Mysql_fetch_array ($ rs, MYSQL_NUM) is equivalent to the function mysql_fetch_row ().
The returned result is
Array ([0] => 1 [1] => 58.215.76.161 [2] => linux [3] => 1 [4] => http [5] => 80 [6] => http [7] => check_http)
MySQL date functions
Provides you with an in-depth understanding of the MYSQL Cast function.
How to view the three MySQL character sets
View MySQL Default Character Set
Role of MySQL Foreign keys in Databases