hello and thank you in advance to anyone who can help me with this problem.
I've scoured the internetz for a while trying to find a solution to what must be a common question,
but I can't find anything that relates to what I am trying to do.
I have an EDIT form so users can edit their profile. One of the fields is a select menu populated with
the contents of a second table.
Example. A users wants to change their color preference.
USERS
user_id \ name \ color_id
--------------------------
1 | Bob | 1
2 | Steve | 2
3 | Roger | 3
4 | Mike | 4
--------------------------
COLORS
color_id \ color
----------------
1 | Red
2 | Yellow
3 | Green
4 | White
----------------
I would like to
select user_id, name, color_id, color
from USERS inner join colors on users.color_id=colors.color_id where user_id=1
and select * from colors
so that the select menu would display the users choice by default
then populate the select menu with the rest of the available options.
Is this even possible? I'm starting to get desperate looking for a solution.
I know how to do this with a embeddded select menu, just not one with a second table. In real life the 'color' table is approx 400 rows.
Again, any help with this would be greatly appreciated!