Hello all. Thanks for the help!
Table `posts` holds 'p_id', 'post', 'u_id'
Table `users_profile` holds 'u_id', 'profile_key', 'value'
How do I return one row for each 'p_id' that includes all the information in the `posts` table as well as the information in the `users_profile` table WHERE `posts`.`u_id` = `users_profile`.`u_id` ?
I would also like for the 'profile_key' to become the key for the 'value' when I use $row = mysql_fetch_assoc($r); in my php script.
The problem is that `u_id` in the `users_profile` table is not unique. The table is structured like:
[U]u_id[/U] [U]profile_key[/U] [U]value[/U] 1 first_name Jason 1 last_name Smith 2 first_name Sam 1 birth_date 01/01/1970 2 etc etc
Hope someone can help me. I know it would be simpler to structure the users_profile table with one row for each 'u_id' but I like the idea of doing it as shown above so there would be a potential to have unlimited profile_keys for every user.
p_id = "post id"
u_id = "user id"
Thanks a lot. I have learned a lot from these forums. They are great!