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
Adam Flanagan
8,022 PointsHow could I go about programming this feature and what courses can help me?
Hello,
I am wondering how I would program this feature. Basically what it is is a search bar that you type your town into and it will find events near you. This will be coming from my own database. How could I set this all up and what Treehouse course would be suitable to give me some guidance?
Thank you in advance,
Adam.
3 Answers
Sander de Wijs
Courses Plus Student 22,267 PointsYou might want to start with the PHP courses. There also is a Wordpress plugin which does exactly this called The Events calendar. It's free to download so you can check out how it is built.
Dane Parchment
Treehouse Moderator 11,077 PointsI agree with Sander De Wijs you should definitely start with the php courses, or the ruby on rails courses.
To create this type of program you will basically need to create a search bar (easily done with html) and then have whatever the user types into the search bar sent to the server, their it will check if anything the user entered matches with anything found on the server's database and send back the results. Don't forget security, that is crucial in any application that sends data to the server or database.
That is how to create the program (at its barest), hope that helps.
Michael Collins
433 PointsThis sounds like a standard locator app for stores and such. So, it's not just a matter of typing in one's town because there are many MANY instances of 2 or more towns with the exact same name in different states.
The zip code is one piece of information that everyone is familiar with and has known longitude and latitude.
There are a number of companies that sell Data and API packaged together. The data contains massive tables of all zip codes in the US and the longitude and latitude for each zip code. They also provide APIs in the software flavor of your choice--PERL, PHP, C++, etc.
You import their data into your MySQL database. Then, you use their API to find the distance between any 2 zip codes. You use SQL to "join" their zip code/longitude/latitude data to your own record set of a) stores b) restaurants, c) whatever. Then you get a set of records back sorted by distance.
That's it--in a nut shell.