menriquez Posted June 3, 2008 Share Posted June 3, 2008 yes i am trying to build a generic class that takes a result set from a mysqli->query and builds an object that contains the number of rows and an 2-d associative array with the field name as one of the array indexs. I used mysqli_field_count() to the the number of fields, but can't figure out how to get the field names. advTHANKSance, - mark Link to comment https://forums.phpfreaks.com/topic/108573-solved-getting-field-names-from-mysqli-gtquery/ Share on other sites More sharing options...
Jabop Posted June 3, 2008 Share Posted June 3, 2008 //edit realized you said names, not count. Link to comment https://forums.phpfreaks.com/topic/108573-solved-getting-field-names-from-mysqli-gtquery/#findComment-556755 Share on other sites More sharing options...
menriquez Posted June 3, 2008 Author Share Posted June 3, 2008 yeah i got the number of rows worked out, that was easy...but thxs anyway. i just need access to the field names...i suppose if i had to i could pass them in the object constructor, but i would rather just grab them from the query object. I know they are stored in there somewhere... - mark Link to comment https://forums.phpfreaks.com/topic/108573-solved-getting-field-names-from-mysqli-gtquery/#findComment-556763 Share on other sites More sharing options...
menriquez Posted June 3, 2008 Author Share Posted June 3, 2008 well in case anyone has this problem i figured it out...RTFM, right? mysqli_result::fetch_fields http://us3.php.net/manual/en/mysqli-result.fetch-fields.php happy coding, and don't forget to free your memory! - mark Link to comment https://forums.phpfreaks.com/topic/108573-solved-getting-field-names-from-mysqli-gtquery/#findComment-556927 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.