harkly Posted December 14, 2008 Share Posted December 14, 2008 I am pretty new with php and have a quick question. I want to have a page where the alphabet is listed and are clickable, bringing up all the names of those that start with the particular letter. My question is how would I do that? A form or just pass the info in the URL? I have the page that the letter is passed working but need an idea of the 1st page and how to work with that info. Link to comment https://forums.phpfreaks.com/topic/136903-quick-question/ Share on other sites More sharing options...
mmarif4u Posted December 14, 2008 Share Posted December 14, 2008 Are you want to pull out that information from database for that specific alphabet. if YES, you can use like operator with wildcards. select * from table where name like '%$alphabet%' OR select * from table where name like '%$alphabet' OR select * from table where name like '$alphabet%' Now it depends on your needs, which one you want to use. Link to comment https://forums.phpfreaks.com/topic/136903-quick-question/#findComment-715002 Share on other sites More sharing options...
harkly Posted December 14, 2008 Author Share Posted December 14, 2008 I have the search function working but I need the 1st part. How to pass the info. I want to be able to click on a letter. A B C D E F G H I J K L M N O P Q R S T U V W X Y Z then pull up a list of names. I have the list of names working but not sure how to pass the variable. Here is the code I am using and it works when I put in the letter in the search function. Not sure if I need a form function - this is where I am confused. $search=$_GET["letter"]; $result = mysql_query("SELECT * FROM artist WHERE lastname like '$search%' ORDER by lastname"); Link to comment https://forums.phpfreaks.com/topic/136903-quick-question/#findComment-715006 Share on other sites More sharing options...
harkly Posted December 14, 2008 Author Share Posted December 14, 2008 I got it to work by using a link Link to comment https://forums.phpfreaks.com/topic/136903-quick-question/#findComment-715014 Share on other sites More sharing options...
mmarif4u Posted December 14, 2008 Share Posted December 14, 2008 You have to use form For GET or POST method. Link to comment https://forums.phpfreaks.com/topic/136903-quick-question/#findComment-715022 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.