php The mysql_fetch_row() function is used to get a row from the result set as a numeric array, the syntax is "mysql_fetch_row(data)". This function retrieves a row of data from the result set associated with the result identifier data and returns it as an array, with each result column stored in an array cell.
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
PHP mysql_fetch_row() function gets a row from the result set as an array of numbers.
Syntax
mysql_fetch_row(data)
Parameter description:
data: The data pointer to be used, required parameter, cannot be omitted. The data pointer is the result returned from mysql_query().
Description:
mysql_fetch_row() function returns an array generated based on the rows obtained, and returns false if there are no more rows.
mysql_fetch_row() Gets a row of data from the result set associated with the specified result identifier and returns it as an array. Each result column is stored in a cell of the array, starting at offset 0.
Calling mysql_fetch_row() in sequence will return the next row in the result set, or false if there are no more rows.
Example 1,
<?php $con = mysql_connect("localhost", "hello", "321"); if (!$con) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db("test_db",$con); $sql = "SELECT * from Person WHERE Lastname='Adams'"; $result = mysql_query($sql,$con); print_r(mysql_fetch_row($result)); mysql_close($con); ?>
Example 2:
PHP Video Tutorial"
The above is the detailed content of What is the usage of php mysql_fetch_row. For more information, please follow other related articles on the PHP Chinese website!