Mysql
 sql >> Datenbank >  >> RDS >> Mysql

zwei Tabellen gleichzeitig aktualisieren

Sie können einen Join wie diesen verwenden:

$query = "UPDATE profiledata t1 
JOIN profileprivacy t2 ON (t1.uid = t2.uid) 
SET t1.aboutyou = '$aboutyou', 
    t1.quotes = '$quotes', 
    t2.aboutyouPrivacy = '$aboutyouPrivacy', 
    t2.quotesPrivacy = '$quotesPrivacy' 
WHERE t1.uid = '$sess_uid'";