I am doing a sales report and need to organize the data coming from a bank in firebird to make a report in PHP
, but I am not able to know how much data is coming from the bank. Because the ibase_num_fields
function does not return how many data it is. And then how would you organize the data in a table?
$host='localhost:C:/bd_relatorio/clipp.FDB';
$dbh=ibase_connect($host,'SYSDBA','masterkey');
$stmt = 'SELECT NOME FROM TB_CLIENTE';
$sth = ibase_query($dbh, $stmt);
$total = ibase_num_fields($sth);
if($total > 2){
while ($row = ibase_fetch_row($sth)) {
echo $row[0], "\n";
}
}
echo $total;
ibase_free_result($sth);
ibase_close($dbh);
?>