mysqli_stmt->error -- Returns a string description for last statement error
Syntax
Procedural style:
string mysqli_stmt_error ( mysqli_stmt stmt )
Object oriented style (property):
class mysqli_stmt { string error }
For the statement specified by stmt, mysqli_stmt_error()
returns a containing the error message for the most recently invoked statement function that
can succeed or fail.
Return Values
A string that describes the error. An empty string if no error occurred.
mysqli_query($link, "CREATE TABLE myCountry LIKE Country"); mysqli_query($link, "INSERT INTO myCountry SELECT * FROM Country");
$query = "SELECT Name, Code FROM myCountry ORDER BY Name"; if ($stmt = mysqli_prepare($link, $query)) {
/* drop table */ mysqli_query($link, "DROP TABLE myCountry");
/* execute query */ mysqli_stmt_execute($stmt);
printf("Error: %s.\n", mysqli_stmt_error($stmt));
/* close statement */ mysqli_stmt_close($stmt); }
/* close connection */ mysqli_close($link); ?>
The above example will output:
Error: Table 'world.myCountry' doesn't exist.
Php mysqli stmt error Function syntax tag
mysqli stmt error php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online
Php mysqli stmt error syntax tutorial
php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.