要更新数据库中输入的条目。我有代码并显示错误:

时间:2018-08-18 18:35:58

标签: mysql

这是我必须使用表单编辑更新来更新数据库中条目的代码:

<?php

$nm=$_POST['name'];
$ag=$_POST["age"];
$em=$_POST['email'];
$cn=$_POST['contact'];
$ad=$_POST['address'];

require("connection.php");
$sql = "update signup set name='$nm', age='$ag', email='$em', contact='$cn', address='$ad' WHERE id='$id'";
if(mysqli_query($conn,$sql))
{
    echo "Updated";
} else 
{
    echo "Error:";
}
?>

这些是显示的错误..我尝试过isset然后也显示了分配变量的相同错误。

Notice: Undefined index: name in C:\xampp\htdocs\Signup\update.php on line 3

Notice: Undefined index: age in C:\xampp\htdocs\Signup\update.php on line 4

Notice: Undefined index: email in C:\xampp\htdocs\Signup\update.php on line 5

Notice: Undefined index: contact in C:\xampp\htdocs\Signup\update.php on line 6

Notice: Undefined index: address in C:\xampp\htdocs\Signup\update.php on line 7

Notice: Undefined variable: id in C:\xampp\htdocs\Signup\update.php on line 10
Updated

1 个答案:

答案 0 :(得分:0)

$url = "https://maps.googleapis.com/maps/api/distancematrix/json?origins=".urlencode('Chigaco')."&destinations=".urlencode('New York')."&mode=driving&language=pl-PL&key=secret";

希望这可以回答您的问题。如果可以,请给我的答案评分