如何使用从php中选择的表中的id设置模式内的最大输入数

问题描述 投票:-1回答:1

我想使用模态将输入类型号的最大值设置为数据库中的值。

1。这是我从表中使用的表格。

<form method="post">
     <input type="text" name="iid" value="<?php echo $row['iid'] ?>">
    <button type="submit"  class="btn btn-info Release"  style="margin: 5px;">
 release</button>
    </form>

2。这是我的php。

<?php
if(isset($_POST['iid']))
$id=$_POST['iid'];   

$sql="SELECT * FROM table WHERE id='$id'";
$data=mysqli_query($conn,$sql);
$row=mysqli_fetch_array($data);
?>

3。这是我的模态输入类型编号,我想从表中获取iiid的值。

<input type="number" name="releasequantity" id="releasequantity" min="1" max="<?php echo $row['Quantity'] ?>" class="form-control" placeholder="Enter Quantity" required="">
php mysqli
1个回答
-1
投票
max="<?php echo $row['Quantity']; ?>"  //Use ; after echo
value="<?php echo $row['iid']; ?>"
© www.soinside.com 2019 - 2024. All rights reserved.