Separate Data Shown With PHP

0

I am showing data in a table through a combobox, but the problem I have is that the words are very close, they need a space, could someone tell me how I would do that?

This would be the code that I have ...

<?php

    include ("conexion.php");

    $query = mysqli_query($con, "SELECT * FROM basede");

?>
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <link rel="stylesheet" href="css.php">
        <link rel="stylesheet" type="text/css" href="estilos.css">  
    </head>
    <body>

        <table border="1">
            <tr>
                <td><?php echo $_POST['Quimico'];?></td>
            </tr>
        </table>

    <form method="post">    
        <select name="Quimico" id="Quimico" selected="selected">        
            <option value="" >Seleccione Una Opción</option>
            <?php
                while($row = mysqli_fetch_assoc($query)){
            ?>
            <option value="<?php echo $row['CAS'], $row['Concentracion'], $row['Formula'],$row['Densidad']?>"><?php echo $row['Nombre']?></option>
            <?php
                }
            ?>
        </select>   
        <input type="submit">
    </form>

    </body>
</html>

Thanks, I hope answers soon, please

    
asked by The Universe Android 20.11.2018 в 17:24
source

1 answer

0

The line you have here:

<option value="<?php echo $row['CAS'], $row['Concentracion'], $row['Formula'],$row['Densidad']?>"><?php echo $row['Nombre']?> </option>

You can change it by putting blank spaces (or whatever you want) between the variables, I'll give you an example (with blank spaces between the variables):

<option value="<?php echo $row['CAS'].' '.$row['Concentracion'].' '. $row['Formula'].' '.$row['Densidad']?>"><?php echo $row['Nombre']?></option>

Greetings

    
answered by 20.11.2018 в 17:51