when using mySQL, is it possible to do the following insert:

Code:
INSERT INTO address(state_id, name, email)
VALUES( (SELECT state_id FROM states WHERE abbreviation = 'WC'), 'Joe Blow', '[email protected]');
where i get the id from the "inner" querry.

is this legal or s there a better way of doing it?

oh and another thing, what is concidered to be the proper and best way to document a function and a class?