Title: Inline PHP and SQL Queries
Last modified: August 19, 2016

---

# Inline PHP and SQL Queries

 *  Resolved [calebcall](https://wordpress.org/support/users/calebcall/)
 * (@calebcall)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/inline-php-and-sql-queries/)
 * I currently have a site that is written in PHP/HTML that I am working on converting
   to use WordPress. On my main page I have a table that’s built dynamically from
   a database query. I’m trying to do the same thing within WordPress and it doesn’t
   seem to be working. I’ve got the Inline PHP module installed and I’m wrapping
   my php tags with `<exec> </exec>` but my table is not getting built??? All my
   static content shows up but nothing from the query.
 * Is there a better way to build these queries in WordPress (I’m a new WordPress
   user) then using the Inline PHP? Will my PHP SQL queries work with the Inline
   PHP plug-in?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/inline-php-and-sql-queries/#post-1301119)
 * If your main page is a static Page (as opposed to a page of posts), you could
   create a custom template that incorporates your database query and table. No 
   need for any plugins.
 * [http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates](http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates)
 *  Thread Starter [calebcall](https://wordpress.org/support/users/calebcall/)
 * (@calebcall)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/inline-php-and-sql-queries/#post-1301138)
 * BRILLIANT!!! Something so simple. Thanks!
 *  [jeffwithag](https://wordpress.org/support/users/jeffwithag/)
 * (@jeffwithag)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/inline-php-and-sql-queries/#post-1301447)
 * Slight extension to this issue. I can do my queries via the template approach.
   Or I can utilize shortcodes via the page approach. But what if I want to utilize
   shortcodes with the data extracted via the query?
 * Query doesn’t work in page, shortcodes don’t work in template???

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Inline PHP and SQL Queries’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [jeffwithag](https://wordpress.org/support/users/jeffwithag/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/inline-php-and-sql-queries/#post-1301447)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
