1
I am making a sales report and need to organize the data coming from a bank in Firebird make a report on PHP
, however I am not getting know how many data are coming from the bank. Because the function ibase_num_fields
does not return how many are the data. And then how would the organization of this data in 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);
?>
Thank you very much! It worked. Now I need to organize the data that comes in table. If possible could help me ? Because I am unable to display php information inside html, even using the <php tag? ?>
– ProgMen
@Progmen, the first line is fixed because it’s the header, inside the while put something like
<tr><td>valor1</td><td>valor2</td></tr>
for each returned column goes a pair<td></td>
– rray
Correct. I will try to create here, the problem was to make this data appear in html msm. But anything I create another question, already helped me properly. Thank you
– ProgMen