eatc7402 Posted February 19, 2007 Share Posted February 19, 2007 I need to run several to many small queries against the SAME database tables resulting in identically structured (but containing different data) $result set resources that I then need to make into ONE large result. Question. Is there an easy way to JOIN the result sets?? Do I need to convert them each to an array and then do an array_merge on them? Is there an easier way? Can I use the resulting array in the same manner as I used the result set to display the results? eatc7402 Link to comment https://forums.phpfreaks.com/topic/39217-joining-mysql_query-result-sets/ Share on other sites More sharing options...
hitman6003 Posted February 19, 2007 Share Posted February 19, 2007 Use the mysql UNION.... UNION is used to combine the result from multiple SELECT statements into a single result set. http://dev.mysql.com/doc/refman/5.0/en/union.html Link to comment https://forums.phpfreaks.com/topic/39217-joining-mysql_query-result-sets/#findComment-188944 Share on other sites More sharing options...
eatc7402 Posted February 20, 2007 Author Share Posted February 20, 2007 That would work in SOME cases, however I want to manipulate the results of the queries on the PHP dide of things, so my question remains. If I had a search of a thousand individual keys that would be a very very long SQL statement. I'd rather do them one-by-one and combine the results as I go on the PHP side of things. eatc7402 Link to comment https://forums.phpfreaks.com/topic/39217-joining-mysql_query-result-sets/#findComment-189082 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.