This post was last edited by Phpcainiao on 2013-10-14 10:09:27
For example, I now have a user watch with Id,users,pwd,yonghuzu in it.
There are three records in it, and the users have
Admin Admins group (Yonghuzu)
Zhang San VIP advanced User (Yonghuzu)
John Doe VIP Advanced User (Yonghuzu)
Another page, I want to achieve the result of such a child:
For example I have to send a word to one or more users, user groups, how to send. How to design a table to store data reasonably and facilitate reading.
I was going to design ID (AutoNumber), Cont (Sent content), username (single user sent)
It's convenient to send it to a single user,
But how this is to be sent to multiple users, and user groups, you do not know username or the back of how to read more reasonable.
Also consider that after the user logs on, it is convenient to read the message list page about this user.
Reply to discussion (solution)
You can consider the next three sheets.
1. User Grouping
2. User tables
3. Message list sent to the user
Where the user table needs to have a field and a user group association, the message table has a word Gencun User ID number and User Table association.
MySQL Update
1 Hello 1,2,4,5
2 He's good 3,4,5.
3 We're all good.
4 haha 2,3,4
The following array is the user.
The first one is the AutoNumber ID, the second cont content, and the third is the user
I'm going out now. All messages with User ID 4: How do we get out here?
If your watch is like you said, there's no way to get the data out of the SQL statement directly.
Can consider the next day to save a record of information, such as: 4 haha 4
This makes it easier to query.