How to prepare SQL statement with POINT using mysqli when using INSERT

后端 未结 1 1483
你的背包
你的背包 2021-01-16 18:51

I can\'t seem to find where documented to successfully prepare a statement that uses the POINT data type.

This previous question (How to use POINT mysql type with my

相关标签:
1条回答
  • 2021-01-16 19:22

    Try like below;

    $stmt = $this->conn->prepare("INSERT INTO days(day,column_name) VALUES(?,POINT(?,?))"); //column_name is name of of column that you want to insert POINT(lat,lon)
        $stmt->bind_param("sdd", $day, $lat, $lon);
        $stmt->execute();
    
    0 讨论(0)
提交回复
热议问题