I have 2 tables:
1)'table'
'id' - int autoincremented
'name' - string
2) 'table2'
'id' - int
'info' - string
Lets, say the last row in table
has id
=20
After I insert 5 empty rows to table
, last row has id
=25
INSERT INTO `table` (`name`)
VALUES ((""),(""),(""),(""),(""))
1) First thing I need is to add 5 rows with same id
-s and empty info
-s to table2
, right after they were added to table
. Something like that:
INSERT INTO `table2` (`id`,`info`)
VALUES ((21,""),(22,""),(23,""),(24,""),(25,""))
Can I do it using one statement?
2) Second thing I need is to extract these values to a PHP variable, like array or string (21,22,23,24,25), so that it could be used for further actions. Is it possible at all?