i'm trying to insert data into my database mariadb the code is the following:
<?php
require 'conexion.php';
$name = $_POST['name'];
$apellidos = $_POST['apellido'];
$email = $_POST['email'];
$pwd = $_POST['pwd'];
$rnd = rand(100000, 999999);
$sql = "INSERT INTO usuarios (nombre,apellido,correo,id_usuario,contraseña,random,fecha,qr) VALUES ('$name', '$apellidos', '$email','$rnd','$pwd','$rnd',NOW(), 'https://stackoverflow.com');";
mysql_select_db('usuario1');
$retval = mysql_query($sql, $con);
echo'it's ok';
if (!$retval) {
die('Could not enter data: '.mysql_error());
}
echo "Entered data successfully\n";
mysql_close($conn);
?>
the rnd is just for a test. the connection is successfull. i have tested it. when i do the insert the page is in blank. it doesn't show me an error message.