MySQL tables and giving text box suggestions
I am storing user details and group names in seperate tabl开发者_如何学JAVAe. I want to add users to the group and then later I want to send message to the whole group. how can I store which user belongs to which group. When I create the user I dont know which group he will belong to.
My 2nd Question And when User tries to add user to the group via website, the text box should suggest the names starting with the letters he typed in. How to do autocomplete or auto suggest. I need to fetch the User name from user table and feed it to text box.
Example structure for user_group
table is:
userID INT(11) NOT NULL
groupID INT(11) NOT NULL
when user is added to group in that table query will look like
INSERT INTO user_group (`userID`, `groupID`) VALUES ('1', '200');
As Randy says, we need more details :)
you will have 3 tables
user
group
and user_group
you should post some attempted code before anyone can help more with your UI.
精彩评论