How to initialize $wpdb?

Question

I have a .php page in the theme root to check the data of one CUSTOM form.
After receiving this data I need to do a query in a custom mysql table, so I need $wpdb, but I can’t use it directly (or doing global $wpdb) because it is a phisical .php file, so the rewrite rule will not affect the request (the request is not passed to index.php because the file exists).

So In this case how can I create an object $wpdb?

Thanks

0
Dail 2 years 2020-10-22T13:10:23-05:00 0 Answers 10 views 0

Leave an answer

Browse
Browse