Current location: Hot Scripts Forums » Programming Languages » PHP » <input select> & SQL


<input select> & SQL

Reply
  #1 (permalink)  
Old 07-14-04, 06:29 PM
eq1987 eq1987 is offline
Wannabe Coder
 
Join Date: Dec 2003
Posts: 216
Thanks: 0
Thanked 0 Times in 0 Posts
<input select> & SQL

Hello, I am trying to make a search that a user can filter. What I am going to show you is fully functional, but i cant figure out how to further a piece of it.

Ok, this is for a game. If you have ever played games before, you will sometimes see you can choose a Race, or a Class.

Well, in this game, you can choose 16 races, and 5 classes.
The value for both select boxes is a single number.

The item they search has *multiple* races, and classes, this is where i am confused.

I made the item_table like this:
ID : itemname : classlist : racelist

Each list looks like this: 5 3 2 10 3 4 5 6 7 1 1 etc

Now the SQL im using:
This will work for single digit numbers.
$SQL = "SELECT * FROM itemsearch WHERE itemname LIKE '%$user_input%' AND classlist = '$classes' AND racelist = '$races'";

But how can i have the SQL search the list for the $classes $races input?

Thanks
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
1 3 5 4, SQL SELECT, each # another SQL eq1987 PHP 4 07-05-04 07:03 PM
Help with ASP & FORMS blessedrub ASP 0 01-23-04 10:22 AM
union sql msrnivas ASP.NET 1 10-21-03 03:36 PM
ASP Calendar..HELP...pls jimthepict ASP 1 07-31-03 05:01 PM
change my field in this example sal21 ASP 3 07-14-03 02:49 AM


All times are GMT -5. The time now is 05:11 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.