Title: Integrating a PHP script &amp; database with theme
Last modified: August 19, 2016

---

# Integrating a PHP script & database with theme

 *  [ptmcariel](https://wordpress.org/support/users/ptmcariel/)
 * (@ptmcariel)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/integrating-a-php-script-amp-database-with-theme/)
 * Hello, I would like to run a PHP script with a mySQL database while using my 
   wordpress theme. The script calls from a separate database from the one wordpress
   uses, and runs a pagination as well as categories, and I haven’t found a way 
   to integrate it using ‘pages’ in wordpress.
 * There is a solution that I am contemplating: create a file under my theme’s folder
   to use the header.php, etc. But that would mean that I’d have to use the full
   url of that file ([http://site.com/wordpress/wp-content/themes/themename/file.php](http://site.com/wordpress/wp-content/themes/themename/file.php))
   to show my visitors and I don’t want to do this.
 * Is there a way to integrate my script, by either masking the file’s name, or 
   does anyone have a different solution?

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

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/integrating-a-php-script-amp-database-with-theme/#post-1386206)
 * Use a [Page Template](http://codex.wordpress.org/Pages#Page_Templates) and put
   the code (or use a PHP include) in that Template.
 *  Thread Starter [ptmcariel](https://wordpress.org/support/users/ptmcariel/)
 * (@ptmcariel)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/integrating-a-php-script-amp-database-with-theme/#post-1386209)
 * Would that end in .php?
 * To use pagination & category, the link would look something like /…/file.php?
   cat=xyz&p=1, at least that’s how the script is written.
 * Thanks. 🙂
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/integrating-a-php-script-amp-database-with-theme/#post-1386227)
 * Oh I don’t know—maybe someone else will be able to respond to that.

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

The topic ‘Integrating a PHP script & database with theme’ is closed to new replies.

## Tags

 * [integrate](https://wordpress.org/support/topic-tag/integrate/)
 * [integration](https://wordpress.org/support/topic-tag/integration/)
 * [pages](https://wordpress.org/support/topic-tag/pages/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/integrating-a-php-script-amp-database-with-theme/#post-1386227)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
