Using this code:
$query = "select * from `music` WHERE `music`.`catid` = '" . $catid . "'"; I cannot seem to add "ORDER BY artist so that it would be in alphabetical order.
Second issue:
What do I need to do to have Display X amount of records, and then at the top / bottom of table have something that says Next 20 Songs, and then if the person selects Next, on the next page it would say Next / Back.
Here is the complete code:
<?php
$catid = '2';
$sql = "SELECT `name` FROM `category` WHERE `category`.`catid` = '" . $catid . "'";
$query = mysql_query($sql);
$name_res = mysql_fetch_row($query);
$name = $name_res[0];
$query = mysql_query($sql) or die('Error: ' . mysql_error());
?>
<h2> <?php echo "$name"; ?> </h2>
<table width="485" border="1" cellpadding="2" cellspacing="0">
<tr>
<td><strong>Song Title</strong></td>
<td><strong>Artist</strong></td>
<?
$i = 0;
$len = @mysql_num_rows($rs);
$cols = 1;
while ( $i < $len )
{
echo "<tr>";
for ($x = 0; $x < $cols; $x++, $i++)
{
if ( $row = mysql_fetch_array($rs, MYSQL_ASSOC) )
echo "<td class=tdrow3>". $row["song_title"] ." </td>";
echo "<td class=tdrow3>". $row["artist"] ." </td>";
}
echo "</tr>";
}
?>
<? }?>
</table>
Thanks for the help.