Selecting a single data from the database with a drop-down list

0

I need help porfa, my situation is this: I have a database with more than 1000 stored chemical data, and until now and managed to put the names of these chemicals in a drop-down list, through php, but these data I want to show it in a table, I managed to do it, but I am shown all and the data is one on top of another and so, what I want is that when I select my name in the drop-down list, in the tables I only show the data of the name selected and that if none is selected, I left the table blank. Could you help me with that? Porfa

Thank you very much, I hope answers ....

This is the connection file

if($con -> connect_errno){
    die ("Fallo La Conexion:(".$con -> mysqli_connect_errno().")".$con -> mysqli_connect_error());
}?>

Here is where I have the tables and the drop-down list

             TAG ME                                                                

            <table class="etiqueta">
                <tr>
                    <!--TD-->
                    <td class="uno"></td>
                    <td class="dos"></td>
                    <td class="tres"></td>
                    <td class="cuatro"></td>
                    <!--TH-->
                    <th class="uno"></th>
                    <th class="dos"></th>
                    <th class="tres"></th>
                    <th class="cuatro"></th>
                    <th class="cinco"></th>
                    <th class="seis"></th>
                </tr>

                <tr>
                    <td class="cinco"></td>
                    <td class="seis"></td>
                    <td class="siete"></td>
                    <td class="ocho"></td>
                    <td class="nueve"></td>
                    <td class="diez"></td>
                    <td class="once"></td>
                </tr>

                <tr>
                    <td class="doce"></td>
                    <td class="trece"></td>
                    <td class="catorce"></td>
                </tr>
            </table>

            <form action="etiquetas.php" method="post">
                <select name="Quimico" type="submit" id="buscarN">
                    <option>Elige Una Opción</option>
                    <?php
                       while($datos = mysqli_fetch_array($query)){
                    ?>
                    <option name="1"><?php echo $datos['Nombre'];?></option>
                    <?php
                        }
                    ?>
                </select>
            </form>

            <input type="submit" name="btncas" value="Buscar Por CAS" id="btncas">
            <input type="submit" name="prepa" value="Preparaciones" id="prepa">
            <input type="submit" name="menuP" value="Menú Principal" id="menuP">
            <input type="submit" name="buscarfds" value="Buscar FDS" id="buscarfds">
            <input type="submit" name="aggfds" value="Agregar FDS" id="aggfds">

        </div>
    </div>
</body>

    
asked by The Universe Android 18.11.2018 в 00:16
source

0 answers