Is this a server error?

0

I developed an application on which my local server is working perfectly. So when I put it on the web server it is returning me the following error:

Fatal error: Class 'mysqli' not found in

Does anyone know if this is a web server error or not? And if not how do I resolve this?

Here is the connection code:

<?php

$servidor = "local";
$usuario = "usuario";
$senha = "senha";
$tabela = "nomedabase";

$conexao = new mysqli($servidor, $usuario, $senha, $tabela);

if ($conexao->connect_error) {
    die("Erro: " . $conexao->connect_error);
}

$busca = $_POST['palavra'];
$cidade = $_POST ['cidade'];

$sql = "SELECT * FROM empresa WHERE nome LIKE '%$busca%' AND cidade = '$cidade'";
$resultados = $conexao->query($sql);


if ($resultados->num_rows > 0) {
    while($linha = mysqli_fetch_array($resultados)) {
        print("<strong>Nome: </strong>" . $linha['nome'] . "</br>");
        print ("<strong>Endereço: </strong>" . $linha['endereco']."</br>");
        if( isset($_POST['cidade']) && $_POST['cidade'] === 'sao-gabriel-da-palha' ) {
            $fromPerson = 'São Gabriel da Palha';
            echo "<strong>Cidade: </strong>".$fromPerson."</br>";
        }
        print ("<strong>Telefone: </strong>" . $linha['telefone']."</br>");
        echo "<strong>email: </strong>". $linha['email']."</br>";
        echo "<hr>";
    }
} else {
    echo "Nenhum resultado para a sua busca.";
}

$conexao->close();
    
asked by anonymous 12.08.2017 / 17:51

1 answer

2

The solution was to change the version of PHP, because it was in 5.2 on the web server and on the site, it was 7.0. So I changed the server and solved the problem!

    
12.08.2017 / 19:16