You're right about the trig functions. I had to simplify the actual formula because it's really ugly. I did use deg2rad() to convert to radians in the real code.
coln is a column in the mysql table.
What I'm trying to do is to get mysql to obtain the value of coln, then use it to calculate $eqn. It should then compare this calculated value to $x, and use if in the WHERE clause.
If I do this, I'll get records:
SELECT latitude,longitude FROM zipcodes WHERE coln <= '$x'
But this does not return any records:
SELECT latitude,longitude FROM zipcodes WHERE cos(coln) <= '$x'
Any ideas why?