Good day. Tell me please, is it possible to implement this code only in SQL, bypassing PHP? The data table has a field ( email_disp ) that needs to be transferred to another table ( privacy ). The caveat is that the latter already has a user base with the necessary id . There are a lot of answers with INSERT, but it is necessary to update the data, and not to create new records.
$query = DB::use()->query("SELECT id, email_disp FROM data"); while($row = $query->fetch_assoc()) { DB::use()->query('UPDATE privacy SET email_disp = '.$row['email_disp'].' WHERE id = '.$row['id'].'); }