Jump to content


Photo

post code search and surounding area option


  • Please log in to reply
1 reply to this topic

#1 khan kaka

khan kaka
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts
  • Locationaustralia

Posted 16 June 2006 - 09:14 AM

Hi there

i want to be able to search for an exact post code and also for sorounding area.

for example the post codes are 3801 3802 3803 3804 3805 3806 3807 3809.

customer searchs for 3804 but i want to be able to bring up all other as well from 3801 to 3809.


i am going crazy [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /]
khan kaka

#2 jvrothjr

jvrothjr
  • Members
  • PipPipPip
  • Advanced Member
  • 300 posts
  • LocationOhio

Posted 16 June 2006 - 06:52 PM

You could say use between option on your query
$postcodeid = 3804

// this will get you the whole number of 103 percent of the id your searching for
$MaxPCID = int($postcodeid * 1.03)

// this will get you the whole number of 97 percent of the id your searching for
$MinPCID = int($postcodeid * 0.97)


$querystring = "select * from table where (ID between $MinPCID and $MaxPCID) order by postcodeID";
If you understand everything you know nothing!

http://rcchjr.awardspace.com/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users