PHP添加下拉值以更新记录

时间:2018-07-17 20:57:48

标签: php mysql

我有一些用户被PE值选中并返回其记录。我希望能够在表单中添加一个下拉列表以选择我知道如何在HTML中进行操作,但是当我将“ id”发布到“ id”时该如何处理 为PE添加一个下拉列表,以便他们可以选择范围。

if (isset($_POST['submit'])) {
  try {
    $connection = new PDO($dsn, $username, $password, $options);
    $MyGuests =[
      "id"        => $_POST['id'],
      "firstname" => $_POST['firstname'],
      "lastname"  => $_POST['lastname'],
      "email"     => $_POST['email'],
      "PE"       => $_POST['PE'],
      "Department"  => $_POST['Department'],
      "senority"      => $_POST['senority']
    ];

   $sql = "UPDATE MyGuests 
        SET id = :id, 

0 个答案:

没有答案