Hi I am making a Login/Register system, and I can’t connect to InfinityFree MySql. I’ve tryed to host locally a mysql db and it worked, but when I try to connect to infinityFree Sql I cant
The error is in spanish (sorry):
Warning: mysqli::__construct(): (HY000/2002): Se produjo un error durante el intento de conexi?n ya que la parte conectada no respondi? adecuadamente tras un periodo de tiempo, o bien se produjo un error en la conexi?n establecida ya que el host conectado no ha podido responder. in E:\xammp 7.2.7\htdocs\Dragonlandia\register\index.php on line 4
That’s the code
`<?php
session_start();
$SESSION[‘message’] = 'Crea tu cuenta ^^';
$mysqli = new mysqli(‘sql108.epizy.com’,‘epiz_22500190’,‘aPasswordThatIMustn’tShare’,‘members’);
$username = $mysqli->real_escape_string($_POST['username']);
$email = $mysqli->real_escape_string($_POST['email']);
$password = md5($_POST['password']);
$_SESSION['username'] = $username;
$sql = "INSERT INTO epiz_22500190_members (username,email,password)" . "VALUES ('$username','$email','$password')";
if($mysqli->query($sql) === true) {
$_SESSION['message'] = "Registrado satisfactoriamente!";
header("location: ../");
}
else {
$_SESSION['message'] = "El usuario no ha sido aadido a la DB. Contacte al soporte si le pasa mas veces [email protected]";
}
I checked your code and this fragment caught my attention:
in E:\\xammp 7.2.7\\htdocs\\Dragonlandia\\register\\index.php on line 4
Please note that you can only connect to the databases on your hosting account from within that account. Connecting to the databases from elsewhere (whether that’s PHP code on your computer, a mobile app or something else) is not possible. Remote MySQL Access is a premium only feature.
Hello Admin, there is some problem, when I try to testRegister in my page, it “connect” to database but now gives me only my personalized error (“There was a problem registering to DB, if you have more problems like this contact to emailofmysite” and at the end of the email i said to give the error in text but doesn’t gives it). So now I will start testing and checking if I can do this properly. If it stills with the problem I will send information ^^.
(sorry for my english)
PD: Is there any chat like DM to have instant response?