The mysqli_error() function is used to return the error in the most recent MySQL function call that failed. If there are multiple MySQL function calls, the error in the last statement is the one that is pointed out by the function.
Parameters: This function accepts single parameter as mentioned above and described below:
- database_name: It is the database on which operations are being performed. It is a mandatory parameter.
Suppose the operation is being carried out on the table given below:
The output will be:
Error message: Unknown system variable 'Age'
Error message: mysqli_error() expects exactly 1 parameter, 0 given
This example also demonstrates that mysqli_error() needs a database as a parameter.
- How to get the function name inside a function in PHP ?
- PHP | dir() Function
- PHP | Ds\Set contains() Function
- CSS | url() Function
- PHP | exp() Function
- D3.js | d3.set.has() Function
- D3.js | d3.map.set() Function
- PHP | Ds\Map first() Function
- p5.js | arc() Function
- p5.js | mag() Function
- PHP | Ds\Set first() Function
- CSS | var() Function
- PHP | pos() Function
- PHP | key() Function
- D3.js | d3.hsl() Function
- PHP | Ds\Map get() Function
- PHP | end() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.