mysqli_warning_count mysqli->warning_count Returns the number of warnings from the last query for the given link Description Procedural style: intmysqli_warning_count objectlink Object oriented style (property): mysqli intwarning_count mysqli_warning_count returns the number of warnings from the last query in the connection represented by the link parameter. For retrieving warning messages you can use the SQL command SHOW WARNINGS [limit row_count]. Return values Number of warnings or zero if there are no warnings. See also mysqli_errno, mysqli_error, mysqli_sqlstate Example Object oriented style query("CREATE TABLE myCity LIKE City"); /* a remarkable city in Wales */ $query = "INSERT INTO myCity (CountryCode, Name) VALUES('GBR', 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch')"; $mysqli->query($query); if ($mysqli->warning_count) { if ($result = $mysqli->query("SHOW WARNINGS")) { $row = $result->fetch_row(); printf("%s (%d): %s\n", $row[0], $row[1], $row[2]); $result->close(); } } /* close connection */ $mysqli->close(); ?> ]]> Procedural style ]]> The above examples would produce the following output: