Beschreibung

If a statement passed to mysqli_prepare() is one that produces
a result set, mysqli_stmt_result_metadata() returns the result object
that can be used to process the meta information such as total number of fields
and individual field information.

Hinweis:

This result set pointer can be passed as an argument to any of the
field-based functions that process result set metadata, such as:

User Contributed Notes 1 note

If result_metadata() returns false but error/errno/sqlstate tells you no error occurred, this means your query is one that does not produce a result set, i.e. an INSERT/UPDATE/DELETE query instead of a SELECT query.

This is stated in the documentation where it says "If a statement passed to mysqli_prepare() is one that produces a result set, mysqli_stmt_result_metadata() returns the result object", but it might not be clear to everyone what this entails exactly.