php – WP Custom tables query
I returned to PHP / MySQL development after a long break, and I am working on a project that requires some customization.
First, I added a credentials file; then I am referencing that file in my test file to query the custom tables I have in the DB.
This seems to work fine, but now I don’t want to build custom code for each query I need since I have a dozen custom tables.
Ideally, I want to call a function to which I pass the SQL query and get the result.
I also want to display the output in a field or table (depending on the output) in an Elementor widget.
Is this the right way to think? If so, how can I do this?