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 trialMUZ140770 Selestino Gama
4,980 PointsMysql and sliders
Hey guys. Is it possible to save sliders in a database? O how can you achieve a fact that if a site user searches for something then a slider can be called wherever it is. I have created sliders in my project which shows a picture of a tourist attraction some basic description, name, and a link to the hotels in the place. I want a scenario in which if a site user searches the same slide pops up with the same css applied.
Thanks in advance.
Selestino
2 Answers
Jeff Lemay
14,268 PointsAnything is possible! It'll depend on what your users are searching for, but the premise is all pretty simple.
- Store your 'sliders' in a table: name, description, link, path-to-image (you won't store the actual file in your database, just a path to the image on your server)
- When a user performs a search query (lets say they are searching by names), you will do a sql query to get the row WHERE name = $search_query.
- Then return the name, desc, link, and path and print it into your web page.
MUZ140770 Selestino Gama
4,980 PointsThank you hey.