non-object
Gente poderia me ajudar?
estou com esse erro
Fatal error: Call to a member function query() on a non-object in /Applications/XAMPP/xamppfiles/htdocs/ewallet/reportClient.class.php on line 85.
Segue a linha abaixo
private function getTabela(){
$color = false;
$retorno = "";
$retorno .= "<h2 style=\"text-align:center\">{$this->titulo}</h2>";
$retorno .= "<table border='1' width='1000' align='center'>
<tr class='header'>
<th>Descrição</td>
<th>Tipo</td>
<th>Saldo Inicial</td>
</tr>";
$sql = "SELECT * FROM conta WHERE idUsuario = 14 ";
foreach ($this->pdo->query($sql) as $reg):
$retorno .= ($color) ? "<tr>" : "<tr class=\"zebra\">";
$retorno .= "<td class='destaque'>{$reg['descricao']}</td>";
$retorno .= "<td>{$reg['tipo']}</td>";
$retorno .= "<td>{$reg['saldoInicial']}</td>";
//$retorno .= "<td>{$reg['limite']}</td>";
//$retorno .= "<td>{$reg['email']}</td>";
//$retorno .= "<td>{$reg['endereco']}</td>";
//$retorno .= "<td>{$reg['cidade']}</td>";
//$retorno .= "<td>{$reg['uf']}</td>";
$retorno .= "<tr>";
$color = !$color;
endforeach;
$retorno .= "</table>";
return $retorno;
}
o erro ele dá no foreach
foreach ($this->pdo->query($sql) as $reg):
alguem pode me ajudar ?
Discussão (12)
Carregando comentários...