one thing I can't really find is to get the new ROW as result after a SQL INSERT.

last\_inserted\_id() only works if it has an INT ID and if I'm not mistaken it also has to be auto incremented. What I tried now is to create a temporary table and INSERT into the two tables.

It works, only now it is missing the correct ID because it has its own value 0 due to the new table and not like the original ROW. I want to include it in my PHP code and it should also work with different DB tables. Ah and I use MariaDB 10.3 +.

A consideration would be to insert a statement in between "if have last\_insert\_id then a SELECT INTO ... where id = last\_inserted etc. else the snippet below".

```
CREATE OR REPLACE TEMPORARY TABLE tmp_school AS SELECT * FROM school LIMIT 0;
INSERT INTO school ( school_name ) VALUES ( 'blubb' );
INSERT INTO tmp_school ( school_name ) VALUES ( 'blubb' );
SELECT * FROM tmp_school;

```