This topic is locked

Display a map with today's records only

6/17/2016 2:55:17 PM
PHPRunner Tips and Tricks
Sergey Kornilov admin

Q: Is the a way to display GPS locations (map markers) by date or put "WHERE" clause into Geo coordinates sql statement? Basically, new geo coordinates will be added everyday and I need to display only those that where inserted into database on a specific day?
A: Simply add a WHERE clause to the SQL query of the table where you insert your map.

For instance to select today's data you can use something like this:

SELECT * FROM mytable WHERE DATE(posted) = CURDATE()


More info on date functions in MySQL and other databases:

http://xlinesoft.com/blog/2014/11/12/datetime-handling-in-web-applications/

lefty 6/17/2016



Q: Is the a way to display GPS locations (map markers) by date or put "WHERE" clause into Geo coordinates sql statement? Basically, new geo coordinates will be added everyday and I need to display only those that where inserted into database on a specific day?
A: Simply add a WHERE clause to the SQL query of the table where you insert your map.

For instance to select today's data you can use something like this:

SELECT * FROM mytable WHERE DATE(posted) = CURDATE()


More info on date functions in MySQL and other databases:

http://xlinesoft.com/blog/2014/11/12/datetime-handling-in-web-applications/



In mobile mode

Is there any way to autofill customer field in add page using GPS location , if you are near a certain address with customer name that are both stored along with coordinates stored in your MySQL database ? Like autofill the nearest location customer in your database to you in a field / I think HTML5 has this ability but don't know how to incorporate into phprunnner without building a mobile native application . I noticed once that ZILLOW.com used this.