Can anyone tell me how to do this.
Lets say i have a table with categoryid,catname as the fields
categoryid is auto_increment
and in catname are names of the catgorys
example :
1 autoparts
2 baseballs
3 wood
4 paper
Now what i want to do it list on a page just a the first letter of each catname like such and make each a link to the categorie page
A B C D E
F G H I J
K L M N O
Well you get the idea on that...
Currently this is what i have and it list them like this
autoparts
baseballs
wood
paper
<?
$sql="select * from junkcategory order by catname ASC";
$res=mysql_query($sql);
while($obj=mysql_fetch_object($res))
{
$groupname=$obj->catname;
$cid=$obj->categoryid;
if($cid==$catid)$img="<img src='images/z_FOLDER02a.gif'>";else $img="<img src='images/z_FOLDER02.gif'>";
?>
<tr valign="middle">
<td width="4%" height="25" align="left" > </td>
<td height="25" align="left" class="normal">
<? print "$img <a href='index.php?catid=$cid'><b>$groupname</b></a> (".getNumjunk($cid).")";?>
</td>
</tr>
<?
}
?>