title: How to insert spatial data in MySQL with PHP?
body: <p>I want to save my coordinate from my Android application to a MySQL database. For this I created an API in PHP, but my code is not working.</p>
  
  <p><strong>Here is my PHP code:</strong></p>
  
  <pre><code>&lt;?php
    include_once 'db.php';
  
    $nop = $_POST['nop'];
    $plot_bng = $_POST['plot_bng'];
  
    $result = mysqli_query($con, "INSERT INTO sp_house (geom, d_nop)
                                  VALUES (STGeomFromText('POINT($plot_bng)'), '$nop')");
  
    echo json_encode(array("value"=&gt;1));
  
    mysqli_close($con);
  ?&gt;
  </code></pre>
  
  <p>When I try an INSERT query in phpMyadmin, the data is successfully stored in the database.</p>