Doing some tests with PDO, looping, transactions, prepared statements, selects and inserts.
See files runinsert.php and runselect.php as the files that should be called.
In runinsert.php you select the database, table and set the data row to be introduced in a loop.
In runselect.php you select the database, table and the column name to be used in the WHERE clause (the primary key or the id).