SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2003
    Location
    canada
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using latitude/longitude extend search?

    Hello,

    I like to create or extend a search based on latitude/longitude from current location.

    Using kijiji as an example, a user searchs for a item within his/her city/town and finds
    nothing. If nothing is found in the immediate location how do I extend the search to include the next or the nearest
    towns & cities based on current location.


    I have access to latitude & longitude.

    PHP scripting.

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    70
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You could use PDO's rowCount() but it is a bit flaky sometimes. You could also execute a separate query with SELECT COUNT(*) to see how many results are returned.

  3. #3
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,747
    Mentioned
    64 Post(s)
    Tagged
    0 Thread(s)
    There have been several threads in this forum about how to derive distance from lat/long pairs.....
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •