View Full Version : Dynamic mysql search
Captainmonday
04-23-2009, 12:27 AM
Hey everyone!
I'm looking for help with a dynamic search system for one of my sites I just started working on.
I want something like this: http://www.southdakotawow.com/minis
Notice all the search variables on the right? All those nifty drop down boxes and such.
Well that's what I want.
But I have no idea where to start. I know next to nothing about mysql.
I've looked around W3schools, and I seen the search arrays. This is probably what I'm looking for but I don't really know.
Thanks in advance!
amutha
04-23-2009, 10:34 AM
you want the code in php, asp or .net ........
which one you want.... :(
forum_amnesiac
04-23-2009, 10:42 AM
Another question, how do you intend to store the data, tables, text file, etc?
The search on the site that you mention is building up a string that is used when extracting data from the database.
Captainmonday
04-23-2009, 01:17 PM
you want the code in php, asp or .net ........
which one you want.... :(
I code in php.
About how I store the data; If I can do it in a text file that would be great since I'm not all that experienced working with mysql tables.
forum_amnesiac
04-23-2009, 01:39 PM
I personally feel that the choice of how to store the data is dependant on the volume of data, number of fields, etc.
I personally prefer to use MYSQL because I find it quite flexible when it comes to querying, 'searching', for the relevant data.
You need to define your data and what fields, or combinations, you want to be able to query by.
When you have done this it will be easier to get the right advice here.
Captainmonday
04-23-2009, 01:45 PM
Then mysql it is! :)
I'll be using it for a game, similar to the link I provided above.
I'm thinking something smaller though...
Drop downs:
Archetype - Fighter, Mage, Priest, Scout.
Type - Ability, Item, Tactic, Unit.
Cost - 1, 2, 3, 4, 5, 6, 7, 8, 9.
Check boxes:
Sets - Oathbound, Forsworn, Inquisitor, Oathbreaker, Ethernauts, Against the Void.
Rarity - Common, Uncommon, Rare, Ultra Rare, Promo, Fixed, Raid.
There are some others that I might want to add in the future, but these are the primary ones.
amutha
04-24-2009, 10:51 AM
Archetype - Fighter, Mage, Priest, Scout.
Type - Ability, Item, Tactic, Unit.
Cost - 1, 2, 3, 4, 5, 6, 7, 8, 9.
Check boxes:
Sets - Oathbound, Forsworn, Inquisitor, Oathbreaker, Ethernauts, Against the Void.
Rarity - Common, Uncommon, Rare, Ultra Rare, Promo, Fixed, Raid.
you store category in same table or single table. like
you store in same table means (Archetype, type, cost, sets, rarity,....)
or each one is a single table like
Archetype
type
cost
sets
rarity
....
AdrielGreene
04-24-2009, 05:24 PM
You can start with the dropdown menu here.
http://www.echoecho.com/htmlforms11.htm
Have you worked with forms before?
I'm assuming you have and you've put the data into .txt files. This is quick and effective but unorganized and can lead to security issues. Think of MySQL as an Excel chart.
Archetype - Fighter
Type - Item
Cost - 6
Sets - Ethernauts
Rarity - Raid.
These columns would associate with what? Are people joining as members on this site or are you displaying a 1337 l00t database to people who come on your site?
If you have members you could add a field called user_id (login name)
[User_ID] - captainmonday -AdrielGreene
[Archetype] - Fighter - mage
[Type] - Item - unit
[Cost] - 6 - 2
[Sets] - Ethernauts - Inquisitor
[Rarity] - Raid. - rare
These fields are associative. You can call the field Type WHERE User_ID is equal to "Captainmonday"; which would display "item"
Do you have a web host? If you do they probably have PHPMyAdmin - a GUI that makes organizing MySQL a bit easier.
Captainmonday
04-27-2009, 02:15 PM
Anyone else? :p
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.