我尝试更新表格,但是告诉我这个错误,我在邮递员中测试,但我不知道发生了什么
注意:未定义的索引:第12行的F:\ wamp64 \ www \ app \ server \ php_tracker_server \ myapp_save.php中的纬度
我在邮递员中附上图片显示错误
<?php
if ( $_SERVER[ "REQUEST_METHOD" ] == "POST" ) {
require 'myapp.php';
myapp();
}
function myapp() {
global $connect;
$id = $_GET["id"];
$latitude = $_POST[ "latitude" ];
$latitude = (float)str_replace(",", ".", $latitude);
$longitude = $_POST[ "longitude" ];
$longitude = (float)str_replace(",", ".", $longitude);
$date = $_POST[ "date" ];
//$appID = $_POST[ "appID" ];
$ruta = $_POST[ "ruta" ];
$query = "update escolar_tracker set latitude='$latitude',longitude='$longitude',date='$date',ruta='$ruta' where id=$id";
//$query = "Insert into mi_app(latitude, longitude, date, appID, ruta) VALUES ('$latitude','$longitude','$date','$appID','$ruta')";
mysqli_query( $connect, $query )or die( mysqli_error( $connect ) );
mysqli_close( $connect );
}
?>