php – WP Custom Table Query

I returned to PHP/MySQL development after a long break, and I’m working on a project that requires some customization. First, I added a credential file; So I am referencing that file in my test file to query the custom tables that are in the DB. It seems to work fine, but now I don’t want to create custom code for each query because I have a dozen custom tables. Ideally, I’d like to call a function to which I pass a SQL query and get the result. I want to display the output in a field or a table (depending on the output) in the Elementor widget. Is this the right way to think? If so how can I do this?

Leave a Comment