Title: Cannot connect to Database using Wp PDO
Last modified: September 9, 2018

---

# Cannot connect to Database using Wp PDO

 *  [kensoftwares](https://wordpress.org/support/users/kensoftwares/)
 * (@kensoftwares)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/cannot-connect-to-database-using-wp-pdo/)
 * Page code
 *     ```
       <!DOCTYPE html>
       <html>
       <body>
   
       <h1>My first PHP page</h1>
   
       <?php
       echo "Hello World!";
       dbTable(“wp_users”)->render(); // call render function on database table, here database table ” tbl ” must be name of your wordpress table
       ?> 
   
       </body>
       </html>
       Page Error
       Payments Edit
   
       My first PHP page
       render(); // call render function on database table, here database table ” tbl ” must be name of your wordpress table
       ?>
       ```
   
    -  This topic was modified 7 years, 9 months ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).

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

 *  [Howdy_McGee](https://wordpress.org/support/users/howdy_mcgee/)
 * (@howdy_mcgee)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/cannot-connect-to-database-using-wp-pdo/#post-10672187)
 * Is this in the context of a plugin? I.E. in the /plugins/ folder and as a proper
   plugin or is this in the context of a theme in `wp-content/themes`?
 * I’m also not familiar with `dbTable()` – is that provided by some framework you’ve
   included? Could you provide a bit more background information regarding your 
   question please?
 *  Thread Starter [kensoftwares](https://wordpress.org/support/users/kensoftwares/)
 * (@kensoftwares)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/cannot-connect-to-database-using-wp-pdo/#post-10672530)
 * yes this is Wp-pdo plugin being used
 *  [Chris Brewer](https://wordpress.org/support/users/wplevels/)
 * (@wplevels)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/cannot-connect-to-database-using-wp-pdo/#post-10673248)
 * Can you please link to the page for this plugin? I can not find a plugin by that
   name. I found one called “WP DB Driver”, is that it? If so, it’s been outdated
   for a very long time.
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/cannot-connect-to-database-using-wp-pdo/#post-10674463)
 * How are you requesting your page? I’m guessing something like _your\_domain.com/
   some/path/filename.php_. If so, WordPress is not involved and any WP or plugin
   functions you might want to call are not available to your page. There are few
   proper ways to involve WP and have plugin functions be available.
 * One way is to make your page file into a [WP page template](https://developer.wordpress.org/themes/template-files-section/page-template-files/#creating-custom-page-templates-for-global-use).
   Save the file in your theme folder, preferably a [child theme](https://codex.wordpress.org/Child_Themes).
   Create a new WP page in the WP admin area that is based on your new template.
   Assign a title, no content required, then publish. Request the page by its permalink
   and the plugin functions should work.

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

The topic ‘Cannot connect to Database using Wp PDO’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 4 replies
 * 4 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/cannot-connect-to-database-using-wp-pdo/#post-10674463)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
