Problem when displaying data in input

0

I'm having problems when it shows me the data well in the imput. I have two options one to add and one to edit, adding data is no problem, but when editing, in the imput I printate the data but not everything, that is, for example, if I have an input with several words for example the surnames, only the first surname appears to me, it does not appear to me if it has a space and then another word. The problem is that if I leave it like this when I click on the edit button, it is saved only with the first data and if that data has more text, it disappears. I do not know if I explain myself ... Is this the subject of the database?

if($_GET){

    $id= $_GET['id'];
    $sql_unico = 'SELECT * FROM reportes WHERE id=?';

$gsnet_unico = $pdo->prepare($sql_unico);
$gsnet_unico->execute(array($id));

$resultado_unico = $gsnet_unico->fetch();
}

<?php if($_GET):?>
    <h2>Editar elementos</h2>
<form method="GET" action="editar_reportes.php">
<input type="text" class="form-control" placeholder="Nombre" name="nombre" value=<?php echo $resultado_unico['nombre']?>>
<input type="text" class="form-control" placeholder="Apellidos" name="apellidos" value=<?php echo $resultado_unico['apellidos']?>>
<input type="text" class="form-control" placeholder="Categoría" name="categoria" value=<?php echo $resultado_unico['categoria']?>>
<input type="text" class="form-control" placeholder="Versión" name="version" value=<?php echo $resultado_unico['version']?>>
<input type="text" class="form-control" placeholder="Comisario 1" name="comisario1" value=<?php echo $resultado_unico['comisario1']?>>
<input type="text" class="form-control" placeholder="Comisario 2" name="comisario2" value=<?php echo $resultado_unico['comisario2']?>>
<input type="text" class="form-control" placeholder="Comisario 3" name="comisario3" value=<?php echo $resultado_unico['comisario3']?>>
<input type="text" class="form-control" placeholder="Comisario 4" name="comisario4" value=<?php echo $resultado_unico['comisario4']?>>
<input type="text" class="form-control" placeholder="Comisario 5" name="comisario5" value=<?php echo $resultado_unico['comisario5']?>>
<input type="text" class="form-control" placeholder="Sanción" name="sancion" value=<?php echo $resultado_unico['sancion']?>>
<input type="hidden" name="id" value=<?php echo $resultado_unico['id']?> >
<button class="btn btn-primary mt-3">Editar</button>
</form>
<?php endif ?>
    
asked by 26.07.2018 в 09:29
source

1 answer

0

First, it could be the subject of the SQL query that brings your data, verify it. Second, it may be that your Input is with max-length and that does not allow you to add a longer value, check the Input tag where you dump the value.

If you could put your SQL query and your code where you send it to the input, it could help you more.

Greetings.

    
answered by 26.07.2018 / 09:49
source