$sql"; # echo "
$sql_where"; - $result = pg_Exec ($conn, "$sql"); + $sth = $dbh->prepare("$sql"); + $sth->execute(); echo "
organizacijska jedinica | status zahtjeva | kontakt osoba | +",$sth->rows()," | |
---|---|---|---|---|
"; if ($row[kontakt_osoba_id]==$kontakt_osoba_id || isset($prava) && $prava==$pr_admin) { print "$row[id]"; @@ -162,9 +164,9 @@ print " | $row[ime] $row[prezime] | $row[orgjed] | ";
- $result1 = pg_Exec ($conn, "select datum,opis from status,status_tip where status.status_tip_id=status_tip.id and osoba_id=$row[id]");
- for ($l = 0; $l < pg_numrows($result1); $l++) {
- $row1=pg_fetch_array($result1,$l);
+ $sth1 = $dbh->prepare("select datum,opis from status,status_tip where status.status_tip_id=status_tip.id and osoba_id=$row[id] order by datum");
+ $sth->execute();
+ while ($row1=$sth1->fetchrow_hash()) {
print "$row1[datum] $row1[opis] "; } print " | $row[kontakt_osoba]"; @@ -199,7 +201,7 @@ echo " "; } - if (pg_numrows($result) >= $on_page) { + if ($sth->rows() >= $on_page) { echo "+ "; } else { echo " "; |