I'm kind of new to SQL, and I'm really only interacting with it enough to get a high score database working. I'm using a php script to access my online MySQL db. Anyways.
What I have is 2 tables, Player and Score. Player has an id, uniqueDeviceId, and chosenname.
Score has the usual things youd expect.
What I'd really like to do in a single query (to reduce complexity...) is to combine the syntaxes of
INSERT INTO scores VALUES
and INSERT INTO scores SELECT...
INSERT INTO scores(score,difficulty,playerid)
id FROM player WHERE uniqueDeviceId = TheUniqueIdThatImProviding)
Makes sense and is called INSERT SELECT. This is an example query for the uniqueDeviceId 123, Score 5 and Difficulty 'easy':
INSERT INTO scores (score, difficulty, playerid) SELECT 5, 'easy', id FROM player WHERE uniqueDeviceId = 123;