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
Tammy Bisetti
5,761 PointsIhaveToAddPhotos into mysql db (500) into ExistingRecords I did that include info about them. Am a beginner. How?
I am a beginner and have just completed database lessons. I have entered around 500 records for items I will want to call up info and photos for to display on a website. I entered them in mysql file in workbench. They are items for rent. Now I need to enter the photos into the photos column. Can anyone tell me how to do that? Is that the best way to store them? In the database? Then how do I retrieve them with PHP?
2 Answers
Ken Alger
Treehouse TeacherTammy;
Personally, I would store file location links in the database and store the photo files themselves separately.
Retrieving them should be a matter of pulling the links out of the database and then putting the associated photos into the web document.
Post back if you need more specifics, but that will also likely require some additional information from your end.
Happy coding,
Ken
Tammy Bisetti
5,761 PointsThank you so much. I had a feeling from the searches I did that it would be the best way. I don't really know how to do that. What would the insert into database be? What information would you need? I have records that include year make model name and then I need the associated photo
Ken Alger
Treehouse TeacherTammy;
It sounds like your table then would need that information along with the URL. Do a search for storing URLs in mySql for some thoughts on the best way to do that. There are a few options and have advantages and disadvantages based on your particular use case.
Ken