This is the code I have made
<?php
$enlace = mysqli_connect("localhost", "root", "", "loteriav2");
if (!$enlace) {
echo "Error: No se pudo conectar a MySQL." . PHP_EOL;
echo "errno de depuración: " . mysqli_connect_errno() . PHP_EOL;
echo "error de depuración: " . mysqli_connect_error() . PHP_EOL;
exit;
}
$Nombre_loteria = $_POST['nombre'];
mysqli_query($enlace, "INSERT INTO loterias ('Nombre_loteria') VALUES ($Nombre_loteria)");
mysqli_query($enlace, "INSERT INTO datos_2dig ('N_loteria') VALUES ($Nombre_loteria)");
mysqli_query($enlace, "INSERT INTO datos_2dig ('ultimo_ingreso_2dig') VALUES (0)");
for ($i=1; $i <= 100; $i++) {
$sql = "INSERT INTO datos_2dig ('dig". $i ."') VALUES (0)";
mysqli_query($enlace, $sql);
}
mysqli_query($enlace, "INSERT INTO datos_3dig ('N_loteria') VALUES ($Nombre_loteria)");
mysqli_query($enlace, "INSERT INTO datos_3dig ('ultimo_ingreso_2dig') VALUES (0)");
for ($i=1; $i <= 1000; $i++) {
$sql = "INSERT INTO datos_2dig ('dig". $i ."') VALUES (0)";
mysqli_query($enlace, $sql);
}
header("Location: index.php");
?>
The page simply does not do anything, it does not register anything in the database. It's as if it did not exist, it even throws me an error message or something similar. I know it may seem very silly but I have very little practice, I would like to know what I am wrong about. In advance, thank you very much, who can give me a hand with my problem. for all who want here is the full code on GitHub link