Comments on tag "$tag_html"\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"); $getcomment =& $conn->prepare("SELECT id, comment FROM tagcomments WHERE tag = ? ORDER BY score DESC"); $result =& $conn->execute($getcomment, $tag); if (DB::isError($result)) { echo "Sorry, can't retrieve comments for this tag"; } else if ($result->numRows() > 0) { echo "

Comment

\n"; while($row =& $result->fetchRow()) { $id = $row[0]; echo "
\n"; echo htmlspecialchars($row[1], ENT_NOQUOTES)."
\n"; echo "Vote up \n"; echo "Vote down \n"; echo "Edit \n"; echo "
\n"; echo "
\n"; } } echo "

\n"; $result->free(); $conn->disconnect(); echo "Back to tag page\n"; echo "Back to index page\n"; ?>