0
When running this page, returns me the following error.
Fatal error: Call to Undefined Function query() in C: Program Files Vertrigoserv www admin.php on line 6
My Php Code.
<?php
include("conexao.php");
$consulta = "SELECT * FROM snaps";
$con = $mysqli=query($consulta) or die($mysqli=error);
?>
<html>
<head>
<meta charset="utf8">
</head>
<body>
<table>
<tr>
<td>Codigo</td>
<td>Nome</td>
<td>SnapChat</td>
<td>Email</td>
<td>Data de Cadastro</td>
</tr>
<?php while($dado = $con->fetch_array()){?>
<tr>
<td><?php echo $dado["id"]; ?></td>
<td><?php echo $dado["nome"]; ?></td>
<td><?php echo $dado["snapc"]; ?></td>
<td><?php echo $dado["email"]; ?></td>
<td><?php echo $dado["created"]; ?></td>
</tr>
<?php }?>
</table>
</body>
</html>
And this is my Connexion.php
<?php
$servidor = "localhost";
$usuario = "root";
$senha = "vertrigo";
$dbname = "snapsje";
//Criar a conexao
$conn = mysqli_connect($servidor, $usuario, $senha, $dbname);
You realize what you’re doing
$mysqli=query
instead of$mysqli->query
? In$mysqli=error
same thing. Typo. By the way, the object$mysqli
nor exists in your code. You have set the connection to the database at$conn
.– Woss
Yes, I changed $mysqli->query to $mysqli=query, because when I leave $mysqli->query, it returns this - Notice: Undefined variable: mysqli in
– LucasRodz
Yeah, I commented on that too.
– Woss