Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/253.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用jquery仅从表中的一列筛选多个值_Php_Jquery_Html_Mysql - Fatal编程技术网

Php 使用jquery仅从表中的一列筛选多个值

Php 使用jquery仅从表中的一列筛选多个值,php,jquery,html,mysql,Php,Jquery,Html,Mysql,我想使用jquery使用multiple-select筛选表中的特定列,其中用户可以选择多个值。 以下是HTML和PHP代码: <table id="simple-table" class="table table-striped table-bordered table-hover"> <thead> <tr> <th>Codice Pezzo</th>

我想使用jquery使用multiple-select筛选表中的特定列,其中用户可以选择多个值。 以下是HTML和PHP代码:

<table id="simple-table" class="table table-striped table-bordered table-hover">
        <thead>
            <tr>
                <th>Codice Pezzo</th>
                <th>Descrizione</th>
                <th class="center">Fornitore
                <div class="col-sm-12">
                    <select multiple="multiple" class="chosen-select form-control tag-input-style" id="fornitore-select" data-placeholder="Scegli un fornitore..." name="fornitore[]"><option value="">  </option><?php
            // esecuzione della query
            $query_fornitore = "SELECT p.Marca FROM pezzi p INNER JOIN distinte d ON (d.ID_Pezzo = p.ID_Pezzo) INNER JOIN ordini o ON (o.ID_Impianto = d.ID_Impianto) WHERE o.Data_Consegna >= '".$_GET["data1"]."' AND o.Data_Consegna <= '".$_GET["data2"]."' AND o.Elaborato = 0 GROUP BY p.Marca;";
            $result_fornitore = @mysqli_query($conn, $query_fornitore);

            // controllo sul numero dei record coinvolti
            if(@mysqli_num_rows($result_fornitore)!=0)
            {
              // risultato sotto forma di array asscociativo
              while($row_fornitore = mysqli_fetch_array($result_fornitore, MYSQLI_ASSOC))
              {
                echo "<option value=\"".$row_fornitore["Marca"]."\">".$row_fornitore["Marca"]."</option>";
              }
            }
            ?></select>
            </div>
                </th>
                <th>Quantità</th>
            </tr>
        </thead>

        <tbody id="body-fornitore">
            <?php
            if(isset($_GET["ordini_materiali"]) && isset($_GET["data1"]) && isset($_GET["data2"])):
                $query_distinta = "SELECT d.ID_Pezzo, p.Descrizione, p.Marca, SUM(d.Quantita), o.Quantita FROM ordini o INNER JOIN distinte d ON (d.ID_Impianto = o.ID_Impianto) INNER JOIN pezzi p ON (p.ID_Pezzo = d.ID_Pezzo) WHERE o.Data_Consegna >= '".$_GET["data1"]."' AND o.Data_Consegna <= '".$_GET["data2"]."' AND o.Elaborato = 0 GROUP BY p.ID_Pezzo;";
                $result_distinta = @mysqli_query($conn, $query_distinta);
                while($row_distinta = mysqli_fetch_array($result_distinta)): ?>
                <tr>
                    <td><?php echo $row_distinta[0]; ?></td>
                    <td><?php echo $row_distinta[1]; ?></td>
                    <td class="row-fornitore"><?php echo $row_distinta[2]; ?></td>
                    <td><?php echo number_format($row_distinta[3]*$row_distinta[4],2,",","."); ?></td>
                </tr>
            <?php endwhile; endif; ?>
        </tbody>
    </table>
使用这种方法,当我选择过滤器考虑表中所有列的多个选项时,我只想过滤一个(具体来说是第三个)。 有办法吗?我快疯了

您正在处理:

#body-fornitore tr
这意味着所有行,而您希望处理第三列,即:

.row-fornitore
关于您正在从事的工作:

#body-fornitore tr
这意味着所有行,而您希望处理第三列,即:

.row-fornitore

关于

我在发帖前试过了。它不再工作了。当我尝试从下拉列表中选择值时,行消失。我在发布问题之前尝试过。它不再工作了。当我尝试从下拉列表中选择值时,行消失。