Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

What do I have to do if I want to follow this online on my current hosting?

I want to work online. Where do I upload the database and how?

Please help!

You can do this simply by creating the database in phpmyadmin in your hosting control panel.

1 Answer

Mike Henry
PLUS
Mike Henry
Courses Plus Student 5,373 Points

If by "online" you mean on your local machine, for me it was just use the downloads --> projects files and put them in my "C:\wamp64\www" directory in a project folder. I so mine is here "C:\wamp64\www\PHP_TeamTreeHouse". Then I just followed along with the videos and when I want to view the page I used WAMP --> localhost and clicked on the project. (http://localhost:1025/PHP_TeamTreeHouse/). If you do not have WAMP installed view the https://teamtreehouse.com/library/windows-local-php-dev-environment course. If you are on a Mac view the https://teamtreehouse.com/library/mac-local-php-dev-environment course.

If by "online" you mean on a hosted service like Heroku you will need to change the database from sqlite to something like mysql. For me this was changing the connection.php file from $db = new PDO("sqlite:".DIR."/database.db"); to $db = new PDO('mysql:host=127.0.0.1;port=3306;dbname=tth_php_database', 'root', ''); I think I also had to change the RANDOM() to RAND().