Most popular tag / value combinations\n"; } else { echo "

Least popular tag / value combinations

\n"; } $dsn = "mysqli://$user:$passwd@$host/$db"; $conn =& DB::connect($dsn); if (DB::isError($conn)) { die ("Cannot connect: " . $conn->getMessage() . "\n"); } $conn->query("SET NAMES utf8"); $result =& $conn->query("SELECT tag, value, count FROM tagpairs ORDER BY count $dir LIMIT $limit"); if (DB::isError($result)) { die ("SELECT failed: " . $result->getMessage() . "\n"); } echo "\n"; echo "\n"; $i = 1; while ($row =& $result->fetchRow()) { if($i % 2) { $style="odd"; } else { $style="even"; } printf('', $style, displayTag($row[0]), displayTag($row[1]), displayNum($row[2]), $row[0]); echo "\n"; $i++; } echo "
tagvalueuses
%2$s%3$s%4$s
\n"; $result->free(); $conn->disconnect(); if($dir == "DESC") { echo "Rare tag / value combinations\n"; } else { echo "Popular tag / value combinations\n"; } $limit += 25; if($dir == "DESC") { echo "More tag / value combinations\n"; } else { echo "More tag / value combinations\n"; } echo "Back to index page\n"; ?>