|
Question:
Insert multiple rows into MySQLI want to create a message to all users in my system and I want to see who has read it.
So I want to insert into existing table : 'Unread messages' with columns 'user_id' and 'message_id' all user Ids from the 'User' table and one and the same message Id. How can I do this in one statement?
Yes, you can insert like this:
insert into unread_messages(user_id, message_id) (select id,12345 from users) Where 12345 is the message_id that you received. Vote:
Please vote! Your opinion matters!
If you haven't found what you've looking for, post a question
|
|