I try to connect to my bd, but it gives the error "Failed to connect!"
The data that is in my bd is:
Database: test Table: Customers
I'm trying to connect through PHP
<?php
$conn = @mysqli_connect("localhost", "root", "", "teste") or die("Falha ao conectar!");
?>
and the validation:
<?php
require_once "conexao.php";
$email = $_GET['idemail'];
$cpf = $_GET['cpf'];
$query = "SELECT * FROM clientes WHERE cpf = '$cpf' AND email = '$email'";
$querySelect = mysqli_query($conn,$query);
if(mysqli_num_rows($querySelect) <=0){
echo"<script type='text/javascript'>alert('Email ou cpf incorretos');window.location.href='index.html';</script>";
die();
}else{
setcookie("login", $cpf);
header("Location:Postagem.html");
}
But whenever I put the correct or incorrect data that is in my bd, it gives the same error as "Failed to connect!"