I have a javascript function where I'm collecting the coordinates of markers from a google map, and attempting to pass them into an sql database using PHP.(我有一个javascript函数,我从Google地图收集标记的坐标,然后尝试使用PHP将其传递到sql数据库中。)
However, there is absolutely no data in my database.(但是,我的数据库中绝对没有数据。)
This is my javascript:(这是我的javascript:)
markers.forEach(function (entry) {
console.log(entry.getPosition());
$.ajax({
url: "http://upload.php",
type: "POST",
data: "entry.getPosition()",
})
})
And this is my php:(这是我的PHP:)
mysql_select_db("coordinates", $con);
mysql_query("insert into coordinates (coordinates) values ('".$_POST['data']."');");
mysql_close($con);
where, for testing purposes, my database has a table named coordinates with a single row named coordinates.(在这里,出于测试目的,我的数据库中有一个名为坐标的表和一个名为坐标的行。)
ask by andromedutch translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…