-1
You need to connect to the database and run the query.
To connect would be something like:
function conectar()
{
try
{
//Localhost
$host = "localhost";
$user = "root";
$password = "";
$database = "nomedobanco";
$conn = mysqli_connect($host, $user, $password, $database);
} catch (Exception $ex) {
die("Erro de conexão: " . mysqli_connect_error());
}
return $conn;
}
And to perform something like:
function listar()
{
$link = conectar();
$query = "SELECT * FROM tablea";
$result = mysqli_query($link, $query) or die(mysqli_error($link));
return $result;
}
Please [Edit] exchange the image for code, easy so we can help. You can even leave the screenshot of the result, but the text code is important. And also describe what is the result that should have appeared.
– Bacco
Where is the connection to the bank? And I also did not see the function to execute the query you did.
– Guilherme Ramalho
The name of your field in the bank is campo1?
– Leonardo Patricio