How can I create a form that stores information in a table in an existing mysql database?
How can I create a form that stores information in a table in an existing mysql database?
Since you do not offer a code base to show you the answer here I leave you a simple example:
<!DOCTYPE html>
<html>
<body>
<h2>HTML Forms</h2>
<form action="/controlador.php">
Nombre:<br>
<input type="text" name="nombre" value="Mickey">
<br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
Page controlador.php
<?php
$conn = new mysqli($servername, $username, $password, $dbname);
$stmt = $conn->prepare("INSERT INTO nombres (primer_nombre) VALUES (?)");
$stmt->bind_param($nombre);
$nombre = $_GET['nombre'];
$stmt->execute();
$conn->close();
?>