I have some question : "insert data in different table but have same id (auto_increment)"
This is my twice table
student
----------------------
id | name | class|
----------------------
score
---------------------------------------------
id | math | english | physical | year |
---------------------------------------------
I have some data like:
John , A , 90 ,80 ,70 ,2015
John , A , 70 ,90 ,50 ,2016
I want result Like:
student
----------------------
id | name | class|
----------------------
1 | John | A |
----------------------
score
---------------------------------------------
id | math | english | physical | year |
---------------------------------------------1 | 90 | 80 | 70 |2015
1 | 70 | 90 | 50 |2016
Because table of student's "id" use Auto_increment
If I want twice table have same id when I insert data
What SQL can I use ??
(I think mysql_insert_id()
is Solution but not sure...)
Thank help !!