I have two database tables, users and logs. I need SQL code to do something along the lines of
foreach(id in users)
insert into logs a record with user_id = id;
endforeach;
I could use php to implement the foreach but I figured there is probably a pure SQL way of doing this. I'm running a MySQL server if that helps.