I have a database with a vertical schema, explained:
Key, Cat, UID, Var, Val, etc…
Where Key is the index, Cat is the category, UID is the identifier for a group of rows, var is the name of the value the row represents and Val is that value. So a few rows would look something like this:
key cat uid var val
1 1 98765 name David
2 1 98765 description handsome, young, sporting,
3 1 98765 phone 123-456-789
4 1 98765 email david@handsome.com
5 1 12345 name Jason
6 1 12345 description cool, hot, tall,
7 1 12345 phone 222-555-1244
8 1 12345 email jason@cool.org
8 1 12345 website www.jason.com
So the goal with the query/php is to get all rows from a specified category, then return an associative array based on the uid for all the rows with that uid. The result would be somehting like
results{
["98765"] => ["name"] = David
=> ["description"] = handsome, young, sporting,
=> ["phone"] = 123-456-789
=> ["email"] = david@handsome.com
["12345"] => ["name"] = Jason
=> ["description"] = cool, hot, tall,
=> ["phone"] = 222-555-1244
=> ["email"] = jason@cool.org
=> ["website"] = www.jason.com
}
Hopefully that’s understandable, let me know if my question is unclear.
Try something like this: