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 trialHector F.
27,464 PointsWhat 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!
1 Answer
Mike Henry
Courses Plus Student 5,373 PointsIf 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().
Ashu Mehra
222 PointsAshu Mehra
222 PointsYou can do this simply by creating the database in phpmyadmin in your hosting control panel.