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 trialGiorgio Manos
424 PointsHello...I need help with the way that i can connect a webiste with a database!
Any type of website! and an "easy"way to connect with database..sql mongo or each!
2 Answers
Ken Alger
Treehouse TeacherGiorgio;
I'm not sure exactly what you're asking by "connect a website to a database." It really depends on what your website backend is programmed in and what, if any, framework you are using as to how it will be accomplished.
What tech stack are you using or wanting to use? That would provide a lot of assistance in being able to provide more specific, and helpful, information.
Ken
Ken Alger
Treehouse TeacherI'd suggest you put the data in a database and the images in a file system. Again, the "how" aspect of this will depend on while language you use on the backend, Python, Java, JavaScript, etc. are all possibilities. For a full-blown blog site, you will likely need to implement routes so that a visitor can go to "yoursite.com/article/1" and ".../article/2" and get the correct blog post. Each language and framework for the language will handle how this is handled slightly differently.
Depending on the framework you decide to use, some databases will be more preferred than others. If you decide to write your own blog application yourself then you would be free to choose which database you use much more easily.
There's a lot to learn for sure, Giorgio Manos. I'm happy to help along the way, but before getting into the specific "how do I do X, Y, and Z" you'll need to provide a better idea as to what you are hoping to accomplish for your project.
Best wishes,
Ken
Giorgio Manos
424 PointsGiorgio Manos
424 PointsYou have right...i am new developer i study now...if i design a site with HTML and CSS a webiste like one sports blog..where i shall put the articles and the images? thats i want to know for the beginning i dont know anything of database and the connection between db and the webiste!