Jump to content

mysqli issue


fou2enve

Recommended Posts

okay so im new to using mysqli, so im using basically the php example online to get it working. but i get a funky error:

 

Fatal error: Call to a member function fetch_field() on a non-object in C:\htdocs\index.php on line 218

 

ive bolded line 218 bellow.

 

any ideas as to what im doing wrong?

 

thanks

_KN

 

$stmt = $mysqli->prepare("SELECT id, name FROM friends");
$stmt->execute();

/* get resultset for metadata */
$result = $stmt->result_metadata();

/* retrieve field information from metadata result set */
[b]$field = $result->fetch_field();[/b]

printf("Fieldname: %s\n", $field->name);

/* close resultset */
$result->close();

/* close connection */
$mysqli->close();

Link to comment
https://forums.phpfreaks.com/topic/98476-mysqli-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.