My anciet code does not work now

Username (e.g. epiz_XXX) or Website URL

paquerasdogrego.epizy.com

Error Message

i’m not see

Other Information

i are using mysqli and trying to adding data to the database, the field login is primary key

the registration page have

<form method="POST" action="cn.php">
<label>celular com ddd ou email</label><input type="text" name="login" id="login" value="">

 <input type="submit" value="próxima">
 </form>

and the cn.php

<?php

$dados = $_POST['login'];


$servidor = "sql308.epizy.com";
$usuario = "epiz_29975807";
$senha = "xxxxxxxxxxxxxxxx";
$dbname = "epiz_29975807_paquera";

//criar a conexão
$conn = mysqli_connect($servidor, $usuario, $senha, $dbname);

$result_usuarios = "INSERT INTO usuarios (login) VALUES ('$dados')";

$resultado_usuarios = mysqli_query($conn, $result_usuarios);


?>

this code worked
in the old days
and now doesn’t add more data
I don’t know how to use the
mysql_errno() and the mysql_error()

Please turn on show PHP errors under PHP settings in the control panel.

1 Like

has no errors
I’m directed to the cn.php page
as if there were no mistakes

You’ll want to use mysqli_errno and mysqli_error, since you’re using mysqli functions to connect to the database.

And you should really learn how to use them if you are going to develop your own software.

There are numerous guides online that can teach you how to use mysqli functions properly. Please follow those guides so you can have proper error handling.

Because you’re not checking for them.

1 Like

the correct server is
sql308.epizy.com”?

Does it say sql308.epizy.com in the control panel? If so, then yes. If not, then no.

Also: please just try to grab the error message. You can speculate what the error is and throw stuff at the wall hoping it is the actual issue, or you can put in a bit of effort now and you’ll know exactly what the error is, have a great start on how to fix it, and have learned something useful to help you if you ever have database troubles again.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.