I have 2 mysql queries retrieved from my php class 2 different methods and they look as it follows
SELECT
domains.id, domains.name, domains.meta_title,
domains.meta_keywords, domains.meta_description,
produkt_modul.keywords, produkt_modul.program_id,produkt_modul.title, produkt_modul.items, produkt_modul.search_type
FROM domains
JOIN produkt_modul ON domains.id = produkt_modul.domains_id WHERE domains.name='$domain_name' ORDER BY position
is fetching the rows for my product modules
and the second one
SELECT
domains.id, text_module.position, text_module.title, text_module.text
FROM domains
JOIN text_module
ON domains.id = text_module.domains_id
WHERE domains.name='$domain_name' AND active= 1 ORDER BY position
should give me the rows of the text modules.
When I generate the html output of the rows in my view I would like to order theme after the positions value.
what should look for example something like:
text_modul pos1
prod_modul pos2
prod_modul pos3
text_modul pos4
the actual view of the rows looks
text_modul1
text_modul4
prod_modul2
prod_modul3
How can I fetch the rows in such a way to have theme in the correct order.
Here’s how to do it in PHP. Note that this code assumes
positionis unique across bothprodukt_moduleandtext_moduleresults.