2
This code is going wrong.
Warning: mysqli_connect(): (42000/1044): Access denied for user 'u469236901_roota'@'10.2.1.41' to database 'u469236901_sysU' in /home/u469236901/public_html/Registerunity.php on line 7
Warning: mysqli_error() expects Parameter 1 to be mysqli, Boolean Given in /home/u469236901/public_html/Registerunity.php on line 7 Error
I want to make a system of Registry and login in Unity.
<?php
$email = $_POST['email'];
$nome = $_POST['name'];
$senha = $_POST['passoword'];
$con = mysql_connect("mysql.hostinger.com.br","usuario_retirado","senha_retirada") or die("Error " . mysql_error($con));
$check = "SELECT * FROM SystemLR_unity" or die("Error in the consult.." . mysql_error($link));
$numrows = mysql_num_rows($check);
$result = mysqli_query($con, $check);
if ($numrows > 0)
{
$senha = md5($senha);
$ins = mysql_query("INSERT INTO SystemLR_unity ( `id` , `email` , `nome` , `senha` ) VALUES ('' , '".$email."' , '".$nome."' , '".$senha."') ; ");
if ($ins)
die ("User Criado Com Susseco!");
else
die ("Error: " . mysql_error());
}
else
{
die("Este User Ja Existe!");
}
?>
This error occurs when your user and password are wrong or the user you created has no privileges, if you are trying to connect to the host via localhost, your home ip is probably not cleared.
– Guilherme Nascimento
Probably the error is at your user’s access level. I tested the code and connected normally on my local server!
– Wandry Moura
I believe that that answer solve the problem
– rray
You left your username and password exposed in the code, I removed them for your safety. Take care when exposing this information, review your code before putting on the internet.
– Rafael Almeida
About the same problem Mysql Query in PHP only works locally and
– rray