Solved

WordPress - Add database tables

Posted on 2015-02-08
4
78 Views
Last Modified: 2015-02-09
I've sort of gotten the impression that I can add custom tables to the WordPress database that I could use for my own purposes.

Is that true?

If so, how do I do that?

And, how do I get access to the database connection info so I can do custom php to manipulate that data.
0
Comment
Question by:Richard Korts
  • 2
4 Comments
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 100 total points
ID: 40597484
WordPress just uses a MySQL database.  You can add whatever you want.  Since Wordpress accesses the database for every page, the connection will probably be open already.  Just look thru the Wordpress code to see how they are doing it and then copy it for your own use.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40597563
This really sounds like it could be going in one of two directions.  Are you talking about adding tables and CRUD by creating custom WordPress code via their functions or as a plugin or simply adding more tables in the same mysql database housing WordPress and querying them in?  Both are possible, but the answer changes a bit depending on what you want to do.

In both cases, you will be leaning on the wpdb class as a shortcut, though:

http://codex.wordpress.org/Class_Reference/wpdb
0
 

Author Comment

by:Richard Korts
ID: 40599057
To All,

I'm gathering that I can open the wp database using phpMyadmin on the server, then add tables, etc.

Is that correct?

Can I use a DIFFERENT database that contains my own data ONLY?
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 400 total points
ID: 40599070
I'm gathering that I can open the wp database using phpMyadmin on the server, then add tables, etc.

Is that correct?

Yes.

Can I use a DIFFERENT database that contains my own data ONLY?

Also yes, you would just need to use a different set of connection functions to connect to both it and the WordPress instance at the same time.  I tend to think that's overthinking the problem...you're already connected to the WordPress database by default, just stick the new tables in there and call it a day.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I want to start by talking about the use of plug-ins for WordPress. I started a web-site for a company I was working for a few years ago; I had extremely basic knowledge of HTML. I am a Graphic Designer by trade so I invited the opportunity as a cha…
In Part I (http://www.experts-exchange.com/Web_Development/Blogs/WordPress/A_8410-Getting-Started-In-WordPress-Part-I.html), I introduced you to the powerful WordPress backend, the WordPress administrative Dashboard.  In Part II, I will introduce yo…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
This video teaches users how to migrate an existing Wordpress website to a new domain.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now