note 129306 added to pdostatement.bindparam
| From: | Anonymous | Date: | Sun, 03 Mar 2024 23:01:44 +0000 |
| Subject: | note 129306 added to pdostatement.bindparam | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221227@lists.php.net to get a copy of this message | ||
You can do:
<form action="prueba2.php" method="POST">
<label>si</label>
<select name="estudiante" id="estudiante">
<?php
$dsn = 'mysql:host=localhost';
$usuario = 'root';
$contraseña = '';
try {
$conexion = new PDO($dsn, $usuario, $contraseña);
$conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$conexion->exec("USE escuela");
$consulta1 = "SELECT dni FROM estudiantes";
$resultado = $conexion->query($consulta1);
while ($todo = $resultado->fetch()) {
echo "<option value=", $todo['dni'],
">", $todo['dni'], "</option>";
}
} catch (PDOException $e) {
echo 'Falló la conexión: ' . $e->getMessage();
}
?>
</select>
<input type="submit" value="Enviar">
</form>
yeah
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.131 (proxied: 83.60.29.95)
----
Manual Page -- https://php.net/manual/en/pdostatement.bindparam.php
Edit -- https://main.php.net/note/edit/129306
Del: integrated -- https://main.php.net/note/delete/129306/integrated
Del: useless -- https://main.php.net/note/delete/129306/useless
Del: bad code -- https://main.php.net/note/delete/129306/bad+code
Del: spam -- https://main.php.net/note/delete/129306/spam
Del: non-english -- https://main.php.net/note/delete/129306/non-english
Del: in docs -- https://main.php.net/note/delete/129306/in+docs
Del: other reasons-- https://main.php.net/note/delete/129306
Reject -- https://main.php.net/note/reject/129306
Search -- https://main.php.net/manage/user-notes.php