1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| <?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
$dbconn = pg_connect("host=localhost port=xx dbname=xx user=postgres password=xxx");
$r=pg_exec ($dbconn, "SELECT count(*) as nb FROM enroll");
$r1=pg_exec ($dbconn , "SELECT count(*) as nb1 FROM imci_visit");
$r2=pg_exec ($dbconn, "SELECT count(*) as nb2 FROM child_classification");
//Count Enroll
for ($i=0; $i<pg_numrows($r); $i++) {
$l=pg_fetch_array($r,$i);
echo 'Enroll : '.$l["nb"]."\n".' ';
}
//Count Imci visit
for ($i=0; $i<pg_numrows($r1); $i++) {
$l=pg_fetch_array($r1,$i);
echo 'Imci : '.$l["nb1"]."\n".' ';
}
//Count Child classification
for ($i=0; $i<pg_numrows($r2); $i++) {
$l=pg_fetch_array($r2,$i);
echo 'Child class : '.$l["nb2"]."\n".' ';
}
?> |
Partager