This shoud be simple but...... I am lost. Basically I just want to do a simple search and order by zipcodes. This I know is not 100% accurate as to how close one zip code is to another but for this it will be fine. I am using MySQL 3.23.58 and my zipcode column is INT(5) What I would like is to query the datebase and order my results as to how close the result is to the submitted zipcode similar to SELECT * FROM member ORDER BY zip [near 34566] I am stuck. TIA
Hi,
How about... (Check for the exact function fo absolute values in MySQL)
select... order by absolute(ZipColum-$submittedZip)
cool I am on my way to the manual.... been digging thru books here :-) Thanks
Try between
http://dev.mysql.com/doc/maxdb/en/85/16665bc71b11d2a97100a0c9449261/content.htm
SELECT * FROM member where zipcode BETWEEN $submited-5 AND $submitted+5
The ABS(zip-'$member_zip') did the trick! 😃
I need to learn to read the question properly. 🙂