Ameslee Posted December 13, 2006 Share Posted December 13, 2006 Hello hope someone can help me. I havent done anything like this before, can anyone tell me how i would display a A-B-C list that people can click on and it displays whatever corresponds to that letter. You know what i mean? also on the page a drop down list that displays services than once clicks on displays what comes under that service. They are both coming from the database, just looking up different rows, i suppose. Can anyone help me?Thanks Link to comment https://forums.phpfreaks.com/topic/30417-a-z-listings/ Share on other sites More sharing options...
trq Posted December 13, 2006 Share Posted December 13, 2006 You would simply need to pass the letter your looking for thru the url, then run a query based on that. eg;[code=php:0]$sql = "SELECT * FROM tbl WHERE data LIKE '{$_GET['search']}%'";[/code] Link to comment https://forums.phpfreaks.com/topic/30417-a-z-listings/#findComment-140026 Share on other sites More sharing options...
Ameslee Posted December 13, 2006 Author Share Posted December 13, 2006 does anyone have an example already coded? I'm finding it confusing on how to go about it. Link to comment https://forums.phpfreaks.com/topic/30417-a-z-listings/#findComment-140029 Share on other sites More sharing options...
mithu_sree Posted December 13, 2006 Share Posted December 13, 2006 Are you trying for some thing like this?[code]for($i = 'A'; $i < 'Z'; $i++) echo "<a href=\"#".$i."\">".$i."|</a>";echo "<a href=\"#".$i."\">".$i."</a>";[/code] Link to comment https://forums.phpfreaks.com/topic/30417-a-z-listings/#findComment-140168 Share on other sites More sharing options...
Ameslee Posted December 18, 2006 Author Share Posted December 18, 2006 is there a simple way than that? Link to comment https://forums.phpfreaks.com/topic/30417-a-z-listings/#findComment-144066 Share on other sites More sharing options...
JasonLewis Posted December 19, 2006 Share Posted December 19, 2006 how could you get much simplier then that. although personally i would've used ASCII.[code=php:0]for($i = 65; $i <= 90; $i++){echo "<a href='sort.php?sortby=".chr($i)."'>".chr($i)."</a>";}[/code]check out the ASCII table at: http://en.wikipedia.org/wiki/ASCII Link to comment https://forums.phpfreaks.com/topic/30417-a-z-listings/#findComment-144138 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.