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
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']

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.