-1
I have that code.
<?php
$link = new mysqli("localhost","root", "SENHAAAA", "BANCO");
$sql_saldo_total = $link->prepare(
"SELECT sum(g) saldo_total
FROM ( SELECT SUM(valor_pg) g
FROM tabela1
WHERE departamento = ?
AND MONTH(data_pg) <= ?
AND YEAR(data_pg) = ?
AND
UNION ALL
SELECT SUM(valor)
FROM tabela2
WHERE tipo = ?
AND MONTH(data) <= ?
AND YEAR(data) = ?
) tabela_virtual");
$sql_saldo_total->bind_param("siisii",
$departamento,
$mes,
$ano,
$departamento,
$mes,
$ano);
?>
But he’s returning the error:
Fatal error: Call to a member function bind_param() on a non-object in
Yes. It really was a distraction. I left him in the middle disturbing my service. Thank you!!!!!
– WebCraft
Yes yes. Thank you!!!
– WebCraft