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!

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

General Discussion

Krystel Hagan
Krystel Hagan
4,731 Points

PHP/SQL Project

Currently I am trying to link a web based document to a server with PHP. I took all the Treehouse courses for this and I am still a bit confused. Here is what I have so far, if anyone would even have an example of how this should look/be set up please feel free to share!

mysql_connect(server, user, password) mysql_select_db("database name") mysql_query(SELECT FROM ("database name")) mysql_fetch_assoc("file/doc inside the database I would like to grab")

Thank you!

1 Answer

David Kaneshiro Jr.
David Kaneshiro Jr.
29,247 Points

Hi Krystel Hagan,

Check out the first example in the following php.net manual page for the mysql_fetch_assoc function:


I believe it is a good starting point. The example is concise, uses all the functions you plan to use, and it shows you how they would work with each other.