I use different sourcerer SQL-query scripts on different modules, which are shown on one page.
Now my page run multiple almost the same SQL-queries when loading a page. It would be nice if I could fire just one SQL-query that gets all needed variables that I will need on a page, and I can use that variable's output on different places/modules on that same page?
Is it possible to make sure the SQL-query is run first and after that the output/variables are global exported, so the wanted variable's can be used on different other places on the same PHP-page?
I recommend you create a separate php file that has a custom PHP class in it. In there you can create methods that do what you need. And you could store the data you get from the database in a (static) property that only gets filled when it is still empty (or null).