Page 1 of 1

anybody have an idea

Posted: Wed Feb 11, 2004 12:58 pm
by grudz
Hi,

I was wondering if anybody had any ideas how to structure this. I have a list of records that can be sorted by name, however, i want to put # - A -B - C - D - E.... etc... (all the letters of the alphabet) so that if the user clicks on "C" it shows everything the starts with "C", now my idea (but i dont think its the best way) was to have a $_GET for all the letters, like i said, does anybody have an easier way?

Thank you in advance

Posted: Wed Feb 11, 2004 1:04 pm
by qads
put A-Z on your page or use one of the scripts here, then use this:

Code: Select all

<?php
$letter = trim(addslashes($_GET['letter']));
$query = "select * from `tablename` where `fieldname` LIKE '$letter%'";
?>

Posted: Wed Feb 11, 2004 1:09 pm
by grudz
thanx, ill try that