Good morning, I'm trying to get the data in a combo and I don't know if something is wrong, it must show me the fixed options.
$pdo = new PDO('mysql:host=localhost;dbname=prueba', 'root', '');
$sql = "SELECT acro_subcategoria FROM tipodocumentos";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$tipodocumentos = $stmt->fetchAll();
And this would be the select
<select>
<?php foreach ($tipodocumentos as $acro_subcategoria): ?>
<option value="<?= $acro_subcategoria['acro_subcategoria']; ?>"></option>
<?php endforeach; ?>
</select>
Unless there is an error on my part, you have the wrong opening of php in the following line:
Try changing
by