Separate Data Shown With PHP


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 ...


    include ("conexion.php");

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

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

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

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


Thanks, I hope answers soon, please

asked by The Universe Android 20.11.2018 в 17:24

1 answer


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>


answered by 20.11.2018 в 17:51