Skip to content
Advertisement

How to output mysqli_fetch_field_direct?

I’m trying to convert this code from mysql to mysqli. But when I print it and open in excel file I got an error.

Catchable fatal error: Object of class stdClass could not be converted to string in C:xampplitehtdocsapptext2.php on line 139

Can someone Teach me how to convert this code in mysqli correctly?

JavaScript

And this the error line

JavaScript

Advertisement

Answer

You can not echo out the output from mysqli_fetch_field_direct() because it:

Returns an object which contains field definition information from the specified result set.

instead try something like this (from PHP docs) to get a sense of what the returned object contains:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement