Assuming (1, 2, 3, 17) are values that corensponds your tables P_id
mysqli_query($con,"INSERT INTO Persons (arrayvalue, table2value)
VALUES ('".$v."', 'Griffin')");
instead of 'griffin' part you could do subselect, like
(sellect coding from table 2 where P_id = arrayvalue)
Doh this is all veird, cant guarantee my answer is what you want.
I need to insert the value from Table2's "coding" field into the "table2value" field from Table1 (where value 'Griffin' is right now).
Basicaly that is wrong, if you have data in one table and you are copying it to another that is surely very bad
If data are already there you should be able to get them out from original table when searching, using join, provided, you have smart table design.
In order to have smart table design, you have to fully understand what join does first, which I think, you don't yet.