php - How to sort results from two databases -
i have 2 web services; asp/sql server web service , php/mysql web service.
i need results both services combined in xml , results need paginated (limited 10 results page). how order results (e.g., alphabetically) when coming 2 separate databases?
it's not clear technology using fetch both queries here, nevertheless:
you query both databases, , merge query result manually (perhaps creating hash results both queries in php). sort hash, , output results needed current page. you'll want cache these results somehow if working lot of data, , doing often.
or, pull data need 1 database other, , perform union query. require fetch data every often, , time depend on doing , how fresh need data be.
Comments
Post a Comment