I've got a table set up like this -
Users
===========
id
userid
friendid
and another set up like this
Game_Objs
===========
id
obj_id
For testing, I need to insert a random number of obj_ids from Game_Objs into a new table associated with friendids, so something like this -
-------------------------------------------------------------------
Friend_Objs
-------------------------------------------------------------------
id | friendid | obj_id
-------------------------------------------------------------------
1 | 123 | aaa
1 | 123 | bbb
1 | 123 | ccc
1 | 456 | abc
1 | 456 | bbb
1 | 456 | cde
Where the number of obj_ids is random for each friendid.
Is this possible using just mysql? If not, what would be the best way to accomplish it in PHP?