1 |
<?php |
2 |
function my_cmp2($a, $b) { return MyCompare($a["title"], $b["title"]); } |
3 |
include_once("inc/conn.php"); |
4 |
$sql = "SELECT spec_id, opis FROM specijalizacije"; |
5 |
$sth = $dbh->prepare($sql); |
6 |
if (!$sth) error("Cannot prepare query: \"$sql\""); |
7 |
if (!$sth->execute()) error("Cannot execute query: \"$sql\""); |
8 |
$menu3 = array(); |
9 |
while ($row = $sth->fetchrow_array()) { |
10 |
list($id2, $txt) = $row; |
11 |
array_push($menu3, array("id" => $id2, "title" => MyEscape($txt))); |
12 |
} |
13 |
$sth->finish(); |
14 |
usort($menu3, "my_cmp2"); |
15 |
$tpl->assign("MENU3", $menu3); |
16 |
$menu = array(); |
17 |
?> |