Title: Converting WordPress database to simple SQl statements
Last modified: August 19, 2016

---

# Converting WordPress database to simple SQl statements

 *  [Lifegiver36](https://wordpress.org/support/users/lifegiver36/)
 * (@lifegiver36)
 * [15 years ago](https://wordpress.org/support/topic/converting-wordpress-database-to-simple-sql-statements/)
 * Hi all,
 * I am trying to find a solution for this and not sure if it’s possible.
 * Say for example I created a custom post called Employee with custom fields in
   it like an address field, zip code field, first name & last name field, position,
   and department. So a admin user can create a post with all that info and it will
   display it as a post on the site. It will essentially be a employee directory
   look up so you can see people who work at the company.
 * Now say I want to take that info from wordpress and create a basic MySql table
   out of with table fields like address, zip code, first name, etc.. How could 
   I take that info from the wordpress DB and either dump it out as insert statements
   or something that would make it easier for me to take what ever it outputs and
   create insert statements to insert into another table which just contains the
   employee info and no tags or anything like?
 * So for example I would need to do something like this:
    INSERT INTO newTable (
   address, zip, first name, etc..) VALUES (‘address field data from custom post’,‘
   zip code field from custom post’, etc..)
 * The reason I need to do this is because I need to be able to give admin users
   the ability to create new employees posts from within the wordpress admin area
   but I also need to be able to create a separate mysql table with the same info
   but not in wordpress format. Now I am wondering if there is an easy way to do
   this or would I just have to manually update the separate table whenever a new
   employee post is created.
 * Or is there a way to have wordpress save the employee info directly into separate
   employee table when a new post is made and not save it as a post within its own
   schema? This way it pulls all the info from that separate table and not where
   it saves its post data. I would have to create custom queries to display the 
   data on the website but just wondering if that’s possible.

Viewing 1 replies (of 1 total)

 *  Thread Starter [Lifegiver36](https://wordpress.org/support/users/lifegiver36/)
 * (@lifegiver36)
 * [15 years ago](https://wordpress.org/support/topic/converting-wordpress-database-to-simple-sql-statements/#post-2051272)
 * Does anyone have any advice on this?

Viewing 1 replies (of 1 total)

The topic ‘Converting WordPress database to simple SQl statements’ is closed to 
new replies.

## Tags

 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [database](https://wordpress.org/support/topic-tag/database/)
 * [exporting](https://wordpress.org/support/topic-tag/exporting/)
 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)
 * [query](https://wordpress.org/support/topic-tag/query/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [Lifegiver36](https://wordpress.org/support/users/lifegiver36/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/converting-wordpress-database-to-simple-sql-statements/#post-2051272)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
