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 Quote Link to comment Share on other sites More sharing options...
Jabop Posted June 3, 2008 Share Posted June 3, 2008 //edit realized you said names, not count. Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.