PHP, error making query [closed]

-1

My problem is that I want to make an appointment, but I can not get all the records, and this is what I can not do. I will change to SQL later, so I left it to test. Can someone help me??

This is the Error

  

WARNING: Mysqli_query () expects parameter 1 to be mysqli, string   date at /home/u777508079/public_html/testeConsult.php at line 19

 <?php

$hostname_conexao = "************";
$username_conexao = "***********";
$password_conexao = "***********";
$database_conexao = "*************";

$sql3 =  mysqli_connect($hostname_conexao, $username_conexao, $password_conexao, $database_conexao);

//$matricula = $_POST['matricula'];   AND morador.id_pessoa = $matricula
$querybanco = mysqli_query( $sql3, "SELECT placa FROM veiculo,morador WHERE morador.id_pessoa = veiculo.id_pessoa  ");

$dados = mysqli_fetch_assoc($querybanco);

$placa2 = $dados['placa'];

$link = "SELECT placa FROM veiculo,morador WHERE morador.id_pessoa = veiculo.id_pessoa";

if ($result = mysqli_query($link, $sql3)) {
    while ($row = mysqli_fetch_assoc ($result)){
        echo $row["placa"];
        echo ",";
    }
}




?>  
    
asked by anonymous 29.11.2016 / 17:07

1 answer

1

The problem is that your parameters are reversed, change as follows:

if($result = mysqli_query($sql3, $link)) {
    //...
}
    
29.11.2016 / 17:15