My query dies in my PC but works on others

Codes here !

Moderators: egami, macek, gesf

Post Reply
Kaparroides
New php-forum User
New php-forum User
Posts: 3
Joined: Sat Jan 28, 2017 8:38 am

Mon Feb 27, 2017 12:59 pm

Hey, so I have this simple query named $query1 that works fine in my school but when I test it at home it dies, I'm kind of a noob, please help me, what am I missing?
btw don't mind the variables' names, I'm Portuguese.

$lig = mysqli_connect('localhost','root','12345678') or die ("Erro de conexão");
mysqli_select_db($lig,"ginasio") or die("Erro na base de dados");

$nome=$_POST["nome"];
$apelido=$_POST["apelido"];
$genero=$_POST["genero"];
$numBI=$_POST["numBI"];
$pass=$_POST["pass"];
$tel=$_POST["tel"];
$morada=$_POST["morada"];
$data=$_POST["ano"] . "-" . $_POST["mes"] . "-" . $_POST["dia"];
$email=$_POST["email"];

$query1 = "insert into Cliente values ('$numBI','$nome','$apelido','$data','$genero','$email','$pass','$tel','$morada')";
echo $query1;
mysqli_query($lig,$query1) or die ("Erro na query1");

chorn
php-forum Active User
php-forum Active User
Posts: 405
Joined: Fri Apr 01, 2016 2:18 am

Mon Feb 27, 2017 10:31 pm

you're missing the mysqli_error() function.

Kaparroides
New php-forum User
New php-forum User
Posts: 3
Joined: Sat Jan 28, 2017 8:38 am

Wed Mar 01, 2017 11:41 am

chorn wrote:
Mon Feb 27, 2017 10:31 pm
you're missing the mysqli_error() function.
Bue i dont have a mysqli_error() function in my schools's PC and it works just fine.

Post Reply