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


How to link PHPmyAdmin?

Hi there!

My friend and I are making an app, and we are making a database using PHPmyAdmin. My question is this - how do I link the database to the HTML document? Can you please provide code?



1 Answer

Randy Hoyt
Randy Hoyt
Treehouse Guest Teacher

PhpMyAdmin is actually a piece of software that reads data from a MySQL database, so it would be more accurate to say that you are making a database using MySQL. Probably the easiest way to connect a web page to a MySQL database is using PHP. It has a native object class of "PDO" that provides an easy way to run queries. You can find some example code for it in this blog post:

(You'll find it towards the bottom in the "Practical Example" section.) I'm actually working on a course that covers this material right now, and I hope to have it out later this fall.