php - Inserting data into a junction table -


this current table design enter image description here

i have many many relationship.

for example created / inserted entry musicians table how pass primary key (id) generated , insert field musician_id musician_x_instrument table?

assuming use mysqli, if using insert_id function:

$query = "insert mycity values (null, 'stuttgart', 'deu', 'stuttgart', 617000)"; $mysqli->query($query); printf ("new record has id %d.\n", $mysqli->insert_id); 

you insert id in join table insert other data other table.


Comments

Popular posts from this blog

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -