Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRifqi Fahmi
23,164 Pointswhy we need to create database in wordpress ??
I am still confused why we need to create database ?? and what happen if we don't ??? thanks :)
3 Answers
Jonathan Grieve
Treehouse Moderator 91,253 PointsEverything that happens behind the scenes... every post you write, every page you make, every theme you develop in Wordpress is stored in a mySQL database. Every dynamic application has to have a database driving it.
Databases are like "memory" for websites.
Once you set up your database when you install Wordpress it will do the rest. :-)
Kevin Korte
28,149 PointsWordpress won't work. It'll forever error with a Error establishing database connection. It has to have a mysql database to access.
In regards to plugins, plugins can and will add more tables to your database when you activate them, if the plugin needs so. It can run sql commands to do so. Custom post types are stored in the wp_posts table, with all of the other posts. Wordpress tracks a post type in the database, so although all the posts are in one table, wordpress knows the post's type via a column in the database.
KAwsar Ahmed
177 PointsThanks you very much.
Konrad Pilch
2,435 PointsIf you do some pure PHP , and get into PHP functions and MySQL , you will exactly understand how it works. The WP databse is already made for you by others, as well as lots of the core WP code is written by others.
Rifqi Fahmi
23,164 PointsRifqi Fahmi
23,164 PointsOOkaaay thankyou :)
KAwsar Ahmed
177 PointsKAwsar Ahmed
177 PointsIf i create a custom post type, How it saved in database, which table, how?
After installing some plugin there is a autometic table in wordpress. Like Woocommerce. How it happen?
Rifqi Fahmi
23,164 PointsRifqi Fahmi
23,164 PointsI think it dynamically create table based on situatuon you are facing with PHP and mySql language work together and store it to database... Dunno Lol #newbie too here
Jonathan Grieve
Treehouse Moderator 91,253 PointsJonathan Grieve
Treehouse Moderator 91,253 PointsI'm not sure precisely but I think it'd be stored somewhere in your wp-content folder in your WordPress installation. But it will be somewhere in there :)