The only safe way to have that work is to have a one-to-one relationship between those two tables. AND if that is true, then why are they separate tables? It appears to me that your database is not fully normalized.
OTOH - you s/b using table 2's primary key to do updates to table 2. Period.
If, in the case that it is ok to do this, then it's simply a matter of reading t1, getting the fk from it and then updating t2. No? It's not a php problem, it's an logic problem.