尝试在php

时间:2018-04-27 18:29:15

标签: php mysql

    ?php
$Onum=$_POST{'Onum'};

$connect = mysql_connect("localhost","root","") or die("ok");
mysql_select_db("dbmsproj") or die ("Database not found");



$query = "SELECT `ITEM-NO` FROM `made-of` WHERE 'ORDER-NO' = '$Onum";
$results = mysql_query($query);

echo "<table>";

while($row = mysql_fetch_array($results)) {
            ?>
                <tr>
                    <td><?php echo $row['ITEM-NO']?></td>
                </tr>

            <?php
            }

       echo "</table>";
?>

我有一个包含3列ITEM-NO,ORDER-NO和ORDER-QUANTITY的表。我想显示特定订单号的项目号。我得到的只是一个空白页面。

下面的代码是html表单。

<div>
<form action="query1.php" method="post">

    <h3>Find Items in an Order</h3>

    <label for="Onum">Enter Order Number</label>
    <input type="Number" id="Onum" name="Onum" required>

    <button type="Submit">Submit</button>

</form>
</div>

0 个答案:

没有答案