I have this code for a select option and it consults the database and brings me the logged in user, but I need to list all the users that I have in the database.
I'm not even storing it in the database when choosing the only user that brings me.
<label>
Usuario
<?php
$usuarios = $database->select("usuario", [ "id_usuario", "nombre", "nick"], ["nombre" => $data['nombre']]);
if ($usuarios) {
echo "<span class='obligatorio'>*</span><select id='usuario' name='usuario' class='width-100' required>";
echo "<option></option>";
foreach ($usuarios as $usuario)
echo "<option value=".$usuario['nombre'].">".$usuario['nick']."</option>";
echo "</select>";
} else echo "<select class='width-100' disabled><option></option></select>";
?>
</label>