In PHP, result means "result". The "mysql_result()" function is used to return the value of a field in the result set. If successful, the function returns the field value. If it fails, it returns false. , the syntax is "mysql_result(data,row,field)".
The operating environment of this tutorial: windows10 system, PHP7.1 version, DELL G3 computer
The result in php is What does it mean
mysql_result() function returns the value of a field in the result set.
If successful, the function returns the field value. If failed, returns false.
Syntax
mysql_result(data,row,field)
Parameter Description
data Required. Specifies the result identifier to use. This identifier is returned by the mysql_query() function.
row Required. Specify the line number. Line numbers start from 0.
field is optional. Specifies which field to retrieve. Can be a field offset value, field name or table.fieldname.
If this parameter is not specified, this function gets the first field from the specified row.
Note
When working with large result sets, you should consider using a function that can retrieve the entire row. These functions return the contents of multiple units in a single function call, much faster than mysql_result().
Also note that specifying a numeric offset in the field parameter is much faster than specifying the field name or tablename.fieldname.
Example
<?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"; $result = mysql_query($sql,$con); echo mysql_result($result,0); mysql_close($con); ?>
The output result is similar to Adams
If you are interested, you can click on "PHP Video Tutorial" to learn more about PHP knowledge study.
The above is the detailed content of What does result mean in php. For more information, please follow other related articles on the PHP Chinese website!