I have a database table structure that works as follows:
search_id: (auto int)
group_id: (unique to group)
so some entries in my db would look like this:
search_id group_id field_name field_value 1 123456 fname John 2 123456 lname Doe 3 123456 email firstname.lastname@example.org 4 789012 fname Jane 5 789012 lname Doe 6 789012 email email@example.com
Now my current search process works as follows;
user searches for value- first query is just a contains on the field_value
forecah match - i return the group_id
my second query is a simple select * from search where group_id = 123456
and that is how i display all of the information i have about that particular group.
My question is- can anyone think of a better way to have dynamic content- (like my field_name : field_value) setup
and it be easier to query?
What is the proper way to do it? Im a self taught programmer- and I just came up with this on my own.
Any help or advice would be greatly appreciated.