Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'distance chapter 3'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 1 result

  1. I am using a variation of the distance computation in Chp 3.... I do not have a large amount of data in the mySqli database... The query takes a very long time to run....I found it has to do with calculating the distance in the query...Was wondering if anyone else had this issue or has any thoughts...My query>>> $sr="SELECT l.load_id, CONVERT_TZ(l.date_posted,'UTC','$tz') AS date_posted, DATE_FORMAT(l.date_available, '%m/%d/%y') AS date_available , e.equipment_type,e.equipment_size,e.weight,e.hazmat,e.liquor,e.bonded, e.xtra_pickup,e.xtra_delivery, o.city_origin, o.state_origin,o.zip_origin, d.city_destination,d.state_destination,d.zip_destination, l.shipper_id, l.comment, l.pickup_time, l.delivery_day, l.delivery_time, l.rate,l.commodity, s.company_name, s.broker_mc , ROUND(DEGREES(ACOS(SIN(RADIANS('$lat_origin')) * SIN(RADIANS(latitude_origin)) + COS(RADIANS('$lat_origin')) * COS(RADIANS(latitude_origin)) * COS(RADIANS('$long_origin' - longitude_origin)))) * 69.09) AS distance_origin , ROUND(DEGREES(ACOS(SIN(RADIANS('$lat_destination')) * SIN(RADIANS(latitude_destination)) + COS(RADIANS('$lat_destination')) * COS(RADIANS(latitude_destination)) * COS(RADIANS('$long_destination' - longitude_destination)))) * 69.09) AS distance_destination FROM loads AS l INNER JOIN origin AS o USING(load_id) INNER JOIN destination AS d USING(load_id) INNER JOIN equipment AS e USING(load_id) INNER JOIN shippers AS s WHERE s.shipper_id = l.shipper_id AND $search_for ";....<<<this varies as to what fields the users wants to search..I use if( (empty($_POST['company_name']))....to select the appropriate $search_for query.... Many thanks Update...I just emptied the tables and reloaded new data....some of my lat and long fields had zeros as I added these fields recently......I only have about 8 columns in now and is quering much faster.......
×
×
  • Create New...