trip272 Posted December 19, 2007 Share Posted December 19, 2007 So I know how to echo all of the data in a table but how do I echo every value of a row based on an index? I am trying to create a php file that echoes row values in the format of: value1=somenumber&value2=somenumber&value3=somenumber ect this is so that I can load this data into flash. I have looked everywhere in search of how to do this any help is appreciated. Link to comment https://forums.phpfreaks.com/topic/82404-echoing-all-data-in-a-row/ Share on other sites More sharing options...
revraz Posted December 19, 2007 Share Posted December 19, 2007 If you build an array from the row data, then you can just do a foreach loop to echo all the results. Link to comment https://forums.phpfreaks.com/topic/82404-echoing-all-data-in-a-row/#findComment-418923 Share on other sites More sharing options...
trip272 Posted December 19, 2007 Author Share Posted December 19, 2007 If you build an array from the row data, then you can just do a foreach loop to echo all the results. is there an array that holds the names of each field? Or would I be able to to grab that somehow? Link to comment https://forums.phpfreaks.com/topic/82404-echoing-all-data-in-a-row/#findComment-418928 Share on other sites More sharing options...
revraz Posted December 19, 2007 Share Posted December 19, 2007 Yes, mysql_fetch_object($result) Link to comment https://forums.phpfreaks.com/topic/82404-echoing-all-data-in-a-row/#findComment-418933 Share on other sites More sharing options...
corbin Posted December 19, 2007 Share Posted December 19, 2007 Good luck getting the field names out of the object fetch_object creates without previously knowing them.... With mysql_fetch_assoc, the row name will be the array key.... Link to comment https://forums.phpfreaks.com/topic/82404-echoing-all-data-in-a-row/#findComment-418954 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.