Jump to content

Quick question


harkly

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.