I want to know how to return the total value of items, I use mysqli to connect to the bank.
Table ec_despesas
have the following fields: (more details of the structure in this image )
id, aba, status, nome, categoria, conta, valor, data
How are you trying to fetch? Here's a simple code for a COUNT (*) using MYSQLi.
$db = new mysqli('localhost', 'usuario', 'senha', 'easycontrol');
if ($db->connect_errno > 0){
die('Impossível se conectar ao banco [' . $db->connect_error . ']');
}
$result = $db->query("select count(*) from ec_despesas");
$row = $result->fetch_row();
echo 'n: ', $row[0];