HTML、PHP多表单“签出”

HTML、PHP多表单“签出”,php,Php,我正试图找出如何让这段代码正常工作。我正试图弄清楚如何获得由多个数据库生成的输入字段组成的表单,以通过下面的PHP if(isset($_GET['sell'])) { foreach($_POST as $x=>$v) { $count = $resource->invSearch($x, $_SESSION['uid']); if($v != 0 || isset($v)) { if(

我正试图找出如何让这段代码正常工作。我正试图弄清楚如何获得由多个数据库生成的输入字段组成的表单,以通过下面的PHP

    if(isset($_GET['sell']))
{
    foreach($_POST as $x=>$v)
    {
        $count = $resource->invSearch($x, $_SESSION['uid']);
        if($v != 0 || isset($v))
        {
            if($count >= $v)
            {
            $sql = "UPDATE user_inventory SET resource_count = resource_count-:ammount WHERE resource_id = :array AND uid = :uid;";
            $sql .= "INSERT INTO 
                        user_inventory(uid, resource_id, resource_count)
                    VALUES
                        (0, :array2, :ammount2) 
                    ON DUPLICATE KEY UPDATE resource_count = resource_count+1";
            $que = $db->prepare($sql);
            $que->bindParam(':uid', $_SESSION['uid']);
            $que->bindParam(':array', $x);
            $que->bindParam(':ammount', $v);
            $que->bindParam(':array2', $x);
            $que->bindParam(':ammount2', $v);
            try { $que->execute(); }catch(PDOException $e){}
            }
            else
            {
                echo $x.'|';
                echo $count.'<br />';
            }
            header('location:index.php?mode=market');
        }   
    }
}
现在是表格

  <form action='?mode=market&sell=true' method='post'>
     <table id='leader' style='text-align: center'>
        <tr><th>Resource Name</th><th>Quantity</th><th>&nbsp;</th></tr>
         <?php $sql = "SELECT resource_id, resource_count FROM user_inventory WHERE uid = :uid";
            $que = $db->prepare($sql);
            $que->bindParam('uid', $_SESSION['uid']);
            try { 
               $que->execute();
           while($row=$que->fetch(PDO::FETCH_BOTH))
           {
            $name = $resource->get_resource_name($row[0]);
            echo "<tr><td>{$name}</td>
                              <td>{$row[1]}</td>
                              <td>
                                <input type='number' name='{$row[0]}' min='0' max='{$row[1]}'> 
                              </td>
                          </tr>";
           }
            }catch(PDOException $e){}
        ?>
       <tr>
           <td>&nbsp;</td> 
           <td>&nbsp;</td>
           <td><input type='submit' value='checkout' /></td>
       </tr>
    </table>
 </form>

你收到了什么。。任何错误。。您得到的是什么数据?您期望的是什么?您没有给我们提供足够的信息来处理-特别是关于您期望的与正在发生的情况的信息,包括您收到的任何错误。@lagbox没有错误。它只是不更新。仅当设置了多个值时才会执行此操作。是,仅当您至少有1个变量被传递到时,此操作才会运行post@lagbox,它似乎只适用于1个变量。