Location: PHPKode > projects > Local Lyric Displayer > lyrics/showbandlist.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//Tr">

<html>
<head>
	<title>Þarký Göster</title>
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-9">
</head>
<link rel="stylesheet" type="text/css" href="lyrics.css">
<body>
<table border="0" width="600">
	<tr>
		<td class="bandname"><a href="showbandlist.php?sort=bandname">Grup Adý</a></td>
	</tr>
<?php 
include ('connect.php');
	if ($sort == "") {
	$sql_string = "select * from lyrics group by bandname";
	} else {
	$sql_string = "select * from lyrics group by bandname order by " . $sort;
	}
	//echo $sql_string . "<br>";
	$result = mysql_db_query ("lld", $sql_string)
    or die ("Query failed");
# get column metadata
$i = 0;

$num_rows = mysql_num_rows($result); 

    for ($i ; $i <= mysql_num_rows ($result) - 1; $i++) {
        if (!mysql_data_seek ($result, $i)) {
            printf ("Cannot seek to row %d\n", $i);
            continue;
        }
 if ($num_rows > 0) {
	$update_result = mysql_db_query ("lld", $sql_update);
	$row = mysql_fetch_object ($result);
	$no = $row->no;
	$bandname = $row->bandname;
?>
	<tr>
		<td class="bandname"><a href="showband.php?band=<?=htmlspecialchars(ucwords(stripslashes($bandname)))?>"><?=htmlspecialchars(ucwords(stripslashes($bandname)))?></a></td>
	</tr>
<?
	}
}
    mysql_free_result ($result);
?>
</table>
</body>
</html>
Return current item: Local Lyric Displayer