Php 包含mysql表中数据的下拉列表

Php 包含mysql表中数据的下拉列表,php,mysql,mysqli,Php,Mysql,Mysqli,我试图创建一个下拉列表,其中包含来自名为services的数据库表的服务。下拉列表与“提交”按钮一起出现,但“我的表格”中的三个选项均未显示 <!DOCTYPE> <html> <head> <title> Search Services</title> </head> <body> <form name ="searchform" method="post

我试图创建一个下拉列表,其中包含来自名为services的数据库表的服务。下拉列表与“提交”按钮一起出现,但“我的表格”中的三个选项均未显示

 <!DOCTYPE>
    <html>
    <head>
    <title> Search Services</title>
    </head>
    <body>
    <form name ="searchform" method="post" action="search.php">

    <?php
    $conn = mysqli_connect("localhost", "eric",
    "password", "ebeichner")
    or die("Cannot connect to database:" . 
    mysqli_connect_error($conn));

    echo "<select service= 'service'>";
    echo '<option value="">'.'Please Select Service'.'</option>';
    $query = mysqli_query($conn, "SELECT service FROM services");

    $query_display = mysqli_query($conn, "SELECT * FROM services");

    while($row=mysqli_fetch_array($query))
    {
        echo "option value='". $row['service']."'>".$row['service']
        .'</option>';

        }

        echo '</select>';

        ?> <input type="submit" name="submit" value="submit"/>
        </form>

        </body>
        <html>

搜索服务

您缺少一个“
echo”。$row['service']”echo "<option value='" . $row['service']. "'>" . $row['service'] . '</option>';