Mysqli_result trong PHP
❮ PHP MySQLi Reference Show Example - Object Oriented stylePerform query against a database: $mysqli = new mysqli("localhost","my_user","my_password","my_db"); // Check connection // Perform query $mysqli -> close(); Look at example of procedural style at the bottom. Definition and UsageThe query() / mysqli_query() function performs a query against a database. SyntaxObject oriented style:$mysqli -> query(query, resultmode) Procedural style:mysqli_query(connection, query, resultmode) Parameter ValuesParameterDescriptionconnectionRequired. Specifies the MySQL connection to usequeryRequired. Specifies the SQL query stringresultmodeOptional. A constant. Can be one of the following:
Technical DetailsReturn Value:For successful SELECT, SHOW, DESCRIBE, or EXPLAIN queries it will return a mysqli_result object. For other successful queries it will return TRUE. FALSE on failurePHP Version:5+PHP Changelog:PHP 5.3.0 added the ability for async queriesExample - Procedural stylePerform query against a database: $con = mysqli_connect("localhost","my_user","my_password","my_db"); if (mysqli_connect_errno()) { // Perform query mysqli_close($con); ❮ PHP MySQLi Reference
|