I would like that when selecting a field in the form with a Select
the description of the acronym would come out, which I already got, what happens is that I would like the description not to enter the ID
of the field, ie , if I select a project in a refillable author field, only the acronyms of the project are selected but in this chaos I am filled with the description as well, and I would like to know if it is possible that this will not happen, that it will show the description but that it will not enter the ID
or NAME
of TD
.
<td>
<select class="form-control" name="acro_proyecto" id="acro_proyecto" onchange="change_documento1(); change_documento2(); change_documento9(); change_documento11()" required="">
<option value=""><?php echo isset($obj_categoria) ? $obj_categoria->__GET('proyecto') : ''; ?> </option>
<?php
$pdo = new PDO('mysql:host=localhost;dbname=*;charset=UTF8', '*', '*');
$pdo->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, "SET NAMES 'utf8'");
$stmt = $pdo->prepare('Select * from proyectos order by acro_proyecto');
$stmt->execute();
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
echo '<option name="' .
($row['acro_proyecto']) . '">' . $row['acro_proyecto'] . '<p>' . '(' .$row['descripcion'] . ')'. '</p>'. '</option>' ;
}
?>
</select>
</td>
In the previous one it is inside the option
that's why it comes out in the select so to say it here I have it out and it does not show it to me:
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
echo '<option name="' .
($row['acro_proyecto']) . '">' . $row['acro_proyecto'] . '</option>' . '<p>' . '(' .$row['descripcion'] . ')'. '</p>' ;
}