is there a way ( in a single query ), to insert multiple rows, and have some rows know the id's of the previously inserted rows?
insert into my_table(contents, css) values ('some text', 'color: blue'); // grab id from that
insert into my_table(contents, css, parent_id) values ('child text', 'color: pink', last_insert_id);
// etc
It's a performance problem to separate them into separate queries, and I'd like to avoid using proc's, so is there a way to do this in mysql only?