简体   繁体   English

如何使 Html 下拉列表选择值打印为 CSV?

[英]How to make the Html dropdown list selected value to be printed as a CSV?

I have this html code and I want when I select name from table category with export.php to export all the data only for this category name.Can you help me please?我有这个 html 代码,我想当我 select 名称从表类别中导出时。php 仅导出此类别名称的所有数据。你能帮帮我吗?

     
        <select>
            <option disabled selected></option>
            <?php
            include "config.php";  // 
            $products_cat = mysqli_query($con, "SELECT name From category");  

            while ($product_categoty = mysqli_fetch_array($products_cat)) {
                echo "<option value='" . $product_categoty['name'] . "'>" . $product_categoty['name'] . "</option>"; 
            }
            ?>
        </select>
        <form method="post" action="export.php">
            <input type="submit" name="expo" value="Export Category">
        </form>
    </form>```

I think Select should be inside the form and please follow these steps to export data as csv.我认为 Select 应该在表格内,请按照以下步骤将数据导出为 csv。 https://www.codexworld.com/export-data-to-csv-file-using-php-mysql/ https://www.codexworld.com/export-data-to-csv-file-using-php-mysql/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM