As a good student, I have a question about the function mysqli_real_escape_string
My code:
$connn=mysqli_connect("localhost","root","", "test");
1// Obtenemos los datos del formulario, asegurándonos que son válidos.
$usuario=mysqli_real_escape_string($connn, $_POST['usuario']);
//$usuario=mysqli_real_escape_string($db, $usuario);
echo "usuario: $usuario </br>";
Well, it's not complete, but it's long. My question is two.
I had to generate a variable "$ connn" again in order to set the parameter "$ link" . I do not know why when I file it already has an include with "conexion.php". Where it is declared but not caught.
What data do you record in the BD? For example, if I put "user2525" I guess I will be recorded in the bd "" user2525 " since it has no character to escape, but if for example I put " user / 25 ", should I record " user25 ", that is, without the characters, since only the string escapes? The truth is that it does not work for me:: (
Thanks friends.