You can create a simple plugin and either add a shortcode to run your php, or filter the_content and add a conditional check for your specific page and inject your DB output. This way your code will be independent of the theme and more portable. Use the wpdb class to query any database /table.
Related Posts:
- Undefined function mysql_connect()
- Fatal error: Call to undefined function mysql_connect()
- MySQL “Or” Condition
- the_date() not working
- How to return number of found rows from SELECT query
- Transaction when using WP functions rather than vanilla SQL?
- How to correctly submit a search form and display the result in an independent page
- Check if post of title already exists
- $wpdb->delete column values IN ARRAY()?
- How to make WordPress plugin check for database changes and then do something?
- Custom SQL query to get List of posts with featured image url
- Delete post revisions on post publish
- Using Echo in ShortCode – Stuck
- Problems migrating WordPress to localhost
- error importing localhost export file to server
- How to sort results from a custom database table
- Update some database fields when post is saved
- Successful or Error Message after running mysql code in functions.php
- sql query to put quotes around numbers in img tag
- No wp-config.php file on local install of wordpress – site still displays
- Use ajax to update_post_meta
- PHP/MySQL issues when running WP on EC2 cloud [closed]
- WordPress get pagination on wpdb get_results
- How to create another version of my site based on the same database
- What SQL / WordPress queries would need a nonce?
- Different database query in function.php using mysqli
- Strange wordpress slowness
- Looking for most performant way to execute several similar WP queries within shortcodes
- Setting All Drafts to ‘exclude-from-catalog’ in WooCommerce
- Stumped on migration
- PHP code inside shortcodes
- Show MySQL errors that occur when I excute $wpdb->insert()
- Is XAMPP faster than running LAMP in WSL on Windows 10? [closed]
- WordPress Site Running Extremely Slow on Dedicated Server
- How to securely provide a $_POST var in WP_Query with PHP 7?
- Create WP_Query to search for posts by their categories or their parent/child categories
- Get updated query results on page after insert in database
- WSoD being caused by this piece of code
- WordPress not reflecting changed of the database
- How can I fix WordPress installation errors?
- How to split links generated into an xml sitemap to avoid exceeding 30 sec maximum execution time?
- Hacked WordPress website /Homepage redirect [closed]
- get_posts() and WP_query limits ‘AND’ conditions to a maximum of 6 for meta value queries in WordPress
- Replacing mysql_escape_string in a custom plugin when moving to PHP7
- Refresh table data with Ajax
- Database query works fine outside WordPress
- Large Woocommerce Site (83,000 items), What Can I Do? [closed]
- $wpdb->insert() does not Insert record in a table
- Not connecting to database in file with multiple MySQL connections
- Way to bulk make all my tags lowercase?
- $Wpdb post meta query is not working with mutliple meta keys and values? [closed]
- php include not working in custom page
- Force Users To Relogin
- email alert for product availability
- Basic wpdb update question
- A $_POST should occur when submit form but is not?
- Pull MySQL data from multiple tables and merge into 1 PHP array
- How do I prepare strings for insertions as values into a MySQL table?
- Using CFDB7 vs Custom MySQL Database [closed]
- add category to posts with tag wordpress
- How can I Use 2 databases with one WordPress install
- Why won’t this wpdb get_results query return results?
- Adding data to custom wordpress database table
- select a single val though a table in wordpress
- populate select options from extra mysql table data
- Removal of all posts content in bulk, keeping the posts itself
- Using Ajax to submit a form, and run a SQL Select query based on user input from the form
- How to store checkbox data for individual users?
- WordPress low speed after migrating to new host
- AWS Lightsail WordPress – connect to database on instance using mysqli
- call to undefined function mysql_connect
- Usermeta data unserialize, extract and display in table in WordPress
- I can’t separate the array by commas
- Using wpdb to connect to a different database is not working
- How to edit content in WordPress and the Polylang – plugin? – with demosite
- How can i limit the number of posts to the most recent 6 in my query?
- Insert data from form to database
- (Who to follow) Twitter widget
- Prepared DB Query from _POST array
- How can I display a query in a page?
- How to properly send many mysql queries via php and what happens with ajax requests after they are sent?
- Conditional statement within WP SQL query
- Passed variable gets undefined variable error on insert on next page
- How to set up an auto delete post?
- WordPress upload images not displaying
- two wordpress sites, two themes, one database, same content
- how to check for wordpress Query errors
- MySQL database migration to WordPress
- Custom query_posts() parameter
- MySQL update text field with ‘
- Query Concatenation
- Display total count of products in orders of a specific order status
- How to get a database field value from a WordPress table? [closed]
- Execute multiple PHP Snippets causes error?
- Error resetting database index using ALTER TABLE in $wpdb->query
- what to do after instlling cyberpanel on VPS
- Can’t insert into a database wordpress
- Updates applied to staging WordPress site affecting production even with different databases
- How to return count number from a wordpress database
- Trying to GET data with ajax from database and show in fullcalendar