Jump to content

results by beginning letter


4egidio

Recommended Posts

I have a website that sells video games. I would like a user to click on a letter (ex. M and have it bring up all the games beginning with M) however I have different systems (xbox, nintendo) and I would need it sorted by these too. For ex. I need a page that just shows xbox games beginning with M. I started to do this by using the like format. See below

 

SELECT *

FROM mastergamelist

WHERE `Description` LIKE 'M%'AND 'System'='Xbox'

 

This is showing me all games that start with M in Xbox system.

My question is, how can create the query so that I don't have make a new query for different game systems and every letter.

 

I only have one table and two 3 rows of data (ID,System and Description).

Link to comment
https://forums.phpfreaks.com/topic/133780-results-by-beginning-letter/
Share on other sites

I found in Dreamweaver where to set my variable (see below), but I'm getting a error -- Missing type for variable:system

 

SELECT *

FROM mastergamelist

WHERE `Description` LIKE '$letter%'AND System='$system'

 

Name: letter

Type: text

Default Value: 1

Runtime Value: $_Get['System']

 

Name: System

Type: text

Default Value: 1

Runtime Value: $_get['System']

 

 

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.