I have 2 tables in my database (friends / guestbook).
I'm using the following query to select all the friends for a specific user.
SELECT FID FROM `friends` as F WHERE UID = 1
What I'd like to do is insert a row on the 'guestbook' table for each result that is returned from the query above.
INSERT INTO `guestbook` (`FID`, `UID`, `message`) VALUES ('FID SHOULD BE EQUAL TO FID FROM PREVIOUS QUERY', '1', 'message goes here!')
How can this be done?