Title: Problem in connecting database
Last modified: August 20, 2016

---

# Problem in connecting database

 *  [npCoda](https://wordpress.org/support/users/npcoda/)
 * (@npcoda)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/problem-in-connecting-database/)
 * I am new babe to WP.
    I have created a folder name **json** in : [http://localhost/my_project_name/wp-content/json/](http://localhost/my_project_name/wp-content/json/)
   Inside directory I have made a file jsonquery.php which performs the code to 
   import data from MySql and convert into JSON.
 * My problem is, how can I connect database in this file. And use WP query function
   to fetch records?
 * Thank you for the support.

The topic ‘Problem in connecting database’ is closed to new replies.

## Tags

 * [database connection](https://wordpress.org/support/topic-tag/database-connection/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [npCoda](https://wordpress.org/support/users/npcoda/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/problem-in-connecting-database/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
