Destramic Posted January 6, 2011 Share Posted January 6, 2011 Hey guys I have an array and want to make it into a sting and separate each array segment by a comma...is there a function for this or should I just do it in a loop myself?...thanks Quote Link to comment https://forums.phpfreaks.com/topic/223608-array-simple-question/ Share on other sites More sharing options...
Pikachu2000 Posted January 6, 2011 Share Posted January 6, 2011 implode Quote Link to comment https://forums.phpfreaks.com/topic/223608-array-simple-question/#findComment-1155824 Share on other sites More sharing options...
Destramic Posted January 6, 2011 Author Share Posted January 6, 2011 Thank you...also can I ask one more thing...i'm working on a mysql class for my frame work and wondered if I would be a good idea to automatical get the data from a table and add to an array and sort and select it from there instead of doing it all from the mysql query?...i hope you understand Quote Link to comment https://forums.phpfreaks.com/topic/223608-array-simple-question/#findComment-1155843 Share on other sites More sharing options...
Pikachu2000 Posted January 6, 2011 Share Posted January 6, 2011 Typically, if something can be done in the DB query, it will be more efficient than doing it in php. Quote Link to comment https://forums.phpfreaks.com/topic/223608-array-simple-question/#findComment-1155845 Share on other sites More sharing options...
Zurev Posted January 6, 2011 Share Posted January 6, 2011 Thank you...also can I ask one more thing...i'm working on a mysql class for my frame work and wondered if I would be a good idea to automatical get the data from a table and add to an array and sort and select it from there instead of doing it all from the mysql query?...i hope you understand You mean whether you should get the table information as an object and manually sort it into an array? Or whether or not to just fetch it as an array? In that case, I would say mysql could fetch it as an array faster than php could sort it into one. Quote Link to comment https://forums.phpfreaks.com/topic/223608-array-simple-question/#findComment-1155846 Share on other sites More sharing options...
Destramic Posted January 6, 2011 Author Share Posted January 6, 2011 Ok thanks guys...you've been a great help...just a thought I had...i'll continue it with mysql...thanks again Quote Link to comment https://forums.phpfreaks.com/topic/223608-array-simple-question/#findComment-1155849 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.