Jump to content
Sign in to follow this  
Erik Richter

Change TEXT field to FLOAT? Needed for Lat/Lang Radius search

Recommended Posts

EDIT2: Actually I've been stupid, mixed up Max and Min for the negatives. Everything works now - pretty slow tho.. If anyone has tipps on making queries faster (talking 1 mio pages) Let me know!


Hey guys,

Is it possible to change fieldtype text to float for a live website?

I have about 1 Mio pages with Lat/Long coordinates (from geocoding) stored in a TEXT field. 

Works perfectly for displaying on maps etc. - but now  I wanted to implement a query filtering for radius (min/max gets calculated correctly before).

This $pages->find does not find results, and I suspect it is because some values are negative? (Lang: -80.45550 for example).

$pages->find("lat>=$minlat, lat<=$maxlat, lang>=$minlng, lang<=$maxlng")   -> fields are TEXT fields.

It looks like the Comparison operator is not working here. Any tips on this? Thank you!!

EDIT: I just changed the fieldtype to Float via Tracy Adminer... no change. The operators are still not giving any results. Strange. Hopefully anyone here has an idea!


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...