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 trial

PHP Integrating PHP with Databases Databases and PHP Getting to Know the Project

Creating a Database

How can I create my own .db file and insert data into it with PHP?

satria saefudin
satria saefudin
497 Points

Yes, I felt there was a "missing link" from previous lessons (https://teamtreehouse.com/library/build-a-basic-php-website). database.db file came out of nowhere? +1 for this question.

1 Answer

First of all, you need to choose and install the DB application like MYSQL, Oracle or etc. Then, you declare two the String variables in PHP. One is for the insert statement(query) and one for the date you want to insert. Then it will be sent to your database. I can't tell you all the details but this is how it works. If you have any further question, please ask me.