title: Mysql Distance from test point to a polygon
body: <p>I have stored some map zones to a table using Geometry type field.</p>
  
  <p>So the inserts are like this:</p>
  
  <pre><code>INSERT INTO zones (zoneName, coords) VALUES ('name',
  PolygonFromText('POLYGON((
  41.11396418691335 1.2562662363052368,
  41.11370552595821 1.2560248374938965,
  41.11851079510035 1.2459397315979004,
  41.11880984984478 1.2461864948272705,
  41.11396418691335 1.2562662363052368))'));
  </code></pre>
  
  <p>Then I have the user position, and I need to know if he is inside some zone. This works well with this:</p>
  
  <pre><code>SELECT id 
    FROM zones 
   WHERE MBRContains(coords,GeomFromText('POINT(41.117783 1.260590)'))
  </code></pre>
  
  <p>But sometimes, user position is not perfect, so I think its better to know wich zone is closest to user position.</p>
  
  <p>That is the part that I don't have any idea about... I found some queries to get distance between two points, but not a point and polygons.</p>