title: Using MySQL 'POINT' and PHP to insert Latitude and Longitude points through a form
body: <p>I'm making a web based application that allows users to create routes based on their input. The user adds waypoints to google maps and takes the latitude and longitude points and copies it into a table on the website that then sends the data to a MySQL database using PHP. </p>
  
  <p>I'm having trouble with adding the lat and lon points to my MySQL database. I'm using the datatype 'POINT'. However, when I send the point to the database I get the error "Cannot get geometry object from data you send to the GEOMETRY field". </p>
  
  <p>I have spent a good few days researching this error. I have tried adding a spatial index but MySQL won't allow me to. I have tried altering the table for so that that row is changed to <code>update table set point_latlon = POINT(lat lon)</code> but it tells me that lat isn't defined and I couldn't find a solution to it. </p>
  
  <p>I truly am stuck with how to fix this error and have exhausted all my resources. </p>
  
  <p>This is my table:</p>
  
  <pre class="lang-MySQL prettyprint-override"><code>CREATE TABLE user_input (
    point_id not null primary key auto_increment,
    point_desc varchar(40),
    point_LatLon not null point
  );
  </code></pre>
  
  <p>And this is my insert statement:</p>
  
  <pre><code>$sql = "INSERT INTO user_input (point_desc, point_latLon) VALUES ('$_GET[waypoint_in_Desc]', 'GeomFromText($_GET[waypoint_in_LatLon])') ;";
  </code></pre>
  
  <p>This is my first time posting so apologies if I've left anything out or not formatted my post correctly. Thanks in advance.</p>