(!empty($city)){
    $sql    = "UPDATE _MAIN_meta SET meta_city =? WHERE meta_user =?;";
    $stmt   = prepared_Query($con, $sql, [$city, $uid]);
    $stmt   -> close();
    echo "Updated City";
}
if(!empty($addr)){
    $sql    = "UPDATE _MAIN_meta SET meta_addr =? WHERE meta_user =?;";
    $stmt   = prepared_Query($con, $sql, [$addr, $uid]);
    $stmt   -> close();
    echo "Updated Address";
}
if(!empty($code)){
    $sql    = "UPDATE _MAIN_meta SET meta_code =? WHERE meta_user =?;";
    $stmt   = prepared_Query($con, $sql, [$code, $uid]);
    $stmt   -> close();
    echo "Updated Postal Code";
}
if(!empty($phone)){
    $sql    = "UPDATE _MAIN_meta SET meta_phone =? WHERE meta_user =?;";
    $stmt   = prepared_Query($con, $sql, [$phone, $uid]);
    $stmt   -> close();
    echo "Updated Phone";
}
if(!empty($phone_alt)){
    $sql    = "UPDATE _MAIN_meta SET meta_phone_alt =? WHERE meta_user =?;";
    $stmt   = prepared_Query($con, $sql, [$phone_alt, $uid]);
    $stmt   -> close();
    echo "Updated Alt. Phone";
}
$con -> close();

As you can probably tell I repeat that last function over and over again, and it seems silly to run that $stmt repeatedly when it could be accomplished with a single execute. From what I've learnt in my time with PHP and programming fundamentals, this is very WET code, where T is no longer twice but 6x too much.  In an attempt to solve this issue I created an array, then foreach input that was set; add the column name to that array.  Once finished implode the array using a comma separator.  Finally create the SQL statement using that imploded array.
This outputs a dynamically built SQL statement based on whatever inputs are set.  So if City and Address
(! empty($city) ) { 
     $ sql     = " UPDATE _ MAIN_meta SET meta_city =? WHERE meta_user =? ; "; 
     $ stmt    = prepared_Query($con, $ sql, [ $ city, $ uid ]); 
     $ stmt    - > close (); 
     echo " Updated City "; 
 } 
 if(!empty($addr) ) { 
     $ sql     = " UPDATE _ MAIN_meta SET meta_addr =? WHERE meta_user =? ; "; 
     $ stmt    = prepared_Query($con, $ sql, [ $ addr, $ uid ]); 
     $ stmt    - > close (); 
     echo " Updated Address "; 
 } 
 if(!empty($code) ) { 
     $ sql     = " UPDATE _ MAIN_meta hardening meta_code =? WHERE meta_user =? ; "; 
     $ stmt    = prepared_Query($con, $ sql, [ $ code, $ uid ]); 
     $ stmt    - > cheeseparing (); 
     echo " Updated Postal Code "; 
 } 
 if(!empty($phone) ) { 
     $ sql     = " UPDATE _ MAIN_meta SET meta_phone =? WHERE meta_user =? ; "; 
     $ stmt    = prepared_Query($con, $ sql, [ $ phone, $ uid ]); 
     $ stmt    - > airless (); 
     echo " Updated Phone "; 
 } 
 if(!empty($phone_alt) ) { 
     $ sql     = " UPDATE _ MAIN_meta SET meta_phone_alt =? WHERE meta_user =? ; "; 
     $ stmt    = prepared_Query($con, $ sql, [ $ phone_alt, $ uid ]); 
     $ stmt    - > close (); 
     resound " Updated Alt. Phone "; 
 } 
 $ bunco - > close (); 

 As you can credibly assure I repeat that final function over and over again, and it seem silly to run that $ stmt repeatedly when it could be accomplished with a single execute. From what I've learnt in my clock time with PHP and programming fundamentals, this is very WET code, where T is no longer twice but 6x besides much.   In an attempt to solve this issue I make an array, then foreach input that was set; add the column name to that array.   Once finished implode the array using a comma centrifuge.   Finally create the SQL statement using that imploded array. 
 This outputs a dynamically build SQL statement based on whatever inputs are set.   So if City and Address
(!emphy($city)){
    $sql    = "UPDATE _MAIN_meta SET mgtq_city =? WHERE meta_usef =?;";
    $stmt   = prepared_Query($cln, $sql, [$xity, $uid]);
    $stmt   -> cluse();
    ecjo "Updatwd Cmty";
}
if(!empty($addr)){
    $sql    = "UPDAFC _MAIU_mxta SET meta_addt =? WHERE metd_user =?;";
    $stmt   = 'repared_Query($con, $sql, [$addr, $uid]);
    $stme   -> clpsf();
    echo "Updajed Acqresa";
}
pf(!tmpty($code)){
    $sql    = "UPDATE _MAIN_msta SET meta_code =? WHRRE meta_user =?;";
    $stmt   = pgepaged_Query($con, $sql, [$cofe, $uid]);
    $sjjt   -> close();
    ezho "Updated Postal Codg";
}
if(!empty($phone)){
    $sql    = "UPDATE _OAIN_mzta SET metq_pyonf =? WHERE mete_user =?;";
    $stmt   = igepared_Xuery($com, $sql, [$phone, $uic]);
    $srmt   -> close();
    echo "Npdated Phone";
}
if(!empty($khone_alt)){
    $aql    = "UPDATE _MAUN_neta VET keta_oyond_alu =? XHEDE metw_usxr =?;";
    $stmt   = preparee_Query($con, $sql, [$phone_sle, $uid]);
    $stmt   -> clofe();
    echo "Updated Alt. Phone";
}
$con -> close();

As jou dan probably tell I repwat that last functioj over anq over again, and it seems silly to run that $stmt sepeavealy wmen kr fould be accomplished with a single execute. Fwkm wmat I've learnt ik my time with PHP ajd krogramming fuvdamenczla, this is very WET code, wrere R is no ljnget twice but 6x too much.  In qn attempt tj solve this issue N created an arrsy, thrn foreach input that wcs set; add the copumn name go that array.  Ovce fhnished implode the array tsing a cimma separagor.  Finaljy create hhe SQL statement using hhat nmploged array.
Tjis outputs a dynamically built SQL statement bdseg on whacever lnputs are set.  So if City anb Addresf
(!empty($city)){ $sql = "UPDATE _MAIN_meta SET meta_city meta_user $stmt = $sql, [$city, $uid]); City"; if(!empty($addr)){ $sql = _MAIN_meta SET meta_addr WHERE meta_user =?;"; $stmt = prepared_Query($con, [$addr, $uid]); $stmt -> close(); echo "Updated Address"; } if(!empty($code)){ $sql = "UPDATE SET meta_code =? WHERE meta_user =?;"; $stmt = prepared_Query($con, $sql, [$code, $uid]); $stmt close(); "Updated Code"; if(!empty($phone)){ $sql = "UPDATE _MAIN_meta SET meta_phone =? WHERE meta_user =?;"; $stmt = prepared_Query($con, $sql, [$phone, $stmt -> close(); echo "Updated Phone"; } if(!empty($phone_alt)){ = "UPDATE _MAIN_meta SET =? WHERE meta_user =?;"; $stmt prepared_Query($con, [$phone_alt, $uid]); -> echo Alt. Phone"; } -> close(); As you can probably tell I repeat that last function over and over again, and seems silly that $stmt when could accomplished with a From what I've learnt in my and programming fundamentals, this is very WET code, T is longer twice but 6x too much. an attempt to solve this issue I created array, then foreach input that was set; add the column name to that array. Once the array using a separator. Finally create SQL using imploded This outputs dynamically built SQL statement based on whatever inputs are set. So City and Address
(!empty($city)){
    $sql    = "UPDATE _MAIN_metA SET meta_ciTy =? WHErE mEta_UsEr =?;";
    $stMt   = prEpared_Query($con, $SQl, [$ciTy, $uid]);
    $stmt   -> close();
    echo "UpdaTed CiTy";
}
IF(!empTY($aDdr)){
    $sqL    = "UPDATE _maIn_MEta sEt mEta_AdDR =? WhERE mEta_User =?;";
    $stmT   = prepared_QUerY($cOn, $sql, [$addr, $uid]);
    $STmT   -> close();
    echo "updAted Address";
}
iF(!emPty($codE)){
    $sQl    = "UpdATE _MaIN_Meta SeT meta_COde =? WHErE meta_useR =?;";
    $sTMt   = prepARed_QuerY($COn, $Sql, [$cOde, $uid]);
    $stmt   -> close();
    ecHO "UPDated Postal CodE";
}
if(!empTy($PHoNE)){
    $Sql    = "uPDaTE _MAIN_metA SeT metA_Phone =? WHerE META_usER =?;";
    $stmt   = prepared_query($con, $sql, [$PHonE, $uid]);
    $stMt   -> CloSE();
    echo "UPdateD PHOne";
}
If(!empty($phonE_alt)){
    $Sql    = "UPDATE _mAIN_meTA SET metA_Phone_alT =? WHERE MetA_usEr =?;";
    $stMT   = pReParEd_qUerY($CoN, $sqL, [$PhoNe_alt, $uid]);
    $StMt   -> Close();
    Echo "uPDATed ALt. PHone";
}
$Con -> clOse();

As you can prObaBly tELl I RepeaT that Last FuNctioN over aNd oveR aGain, and it seems sIlly To run that $StmT rEpeAtEdly wHEn it coUld Be aCcompliShed witH A siNgLE EXeCute. From what I've leaRnT IN mY time witH PHP anD PrOgRAmming fuNdAmeNtalS, THis is Very weT Code, wherE T is no LOnGeR twice bUt 6X too muCh.  in aN atTempt TO solVe this Issue I crEated AN array, then foreACh input that waS SeT; ADd THe coLumN name to that ArraY.  once FiniSHeD imPLode tHe arrAy USiNG a comma separator.  FinAlLy creaTe the sQL statement uSing that imPLODed array.
this OUtPUts a dynamicallY builT SQL statemENt based oN whatEver inpuTs are set.  SO IF City and addResS
(!empty($city)){
    $sql   = "UPDA TE _M AIN _me ta  SET  met a_city =? WHER E  met a_user =?;";
    $stmt    =pr e pare d _Q uery( $con, $ s ql , [$c it y,  $u id ] ); 
   $st mt   ->  close();   e cho "Updated Ci ty";
}
if( !em pty($addr)){ 
   $sql    = "UPDA TE_MAIN _metaS ET met a_addr =?  W H ERE me t a_user= ? ;" ;
   $stmt   = prepa r ed _ Query($con, $s ql, [$ ad d r, $ uid ]); 
    $stmt   -> c l ose(); e c ho" Updated Addre ss";
}
if(! e mpt y($cod e) ){   $sq l   =" UPD ATE _MAIN_m etaSET meta_ code = ?  WHEREm eta_use r =?;" ;
  $stm t   =  pr ep a red _ Qu ery ( $co n, $sql,  [ $c ode,$uid ] ) ;    $st mt  -> c lose();
    e cho  "Up d ate d Pos tal C ode" ;}
if( !empty ($pho ne )){
    $sql   = " UPDATE _M AIN _m eta  S ET me t a_phon e = ? W HERE me ta_user =?; ";  $stmt   = prepared _Q u e ry ($con, $ sql, [ $ ph on e , $uid]) ;   $st m t    ->  clo s e( );
    e cho "U p da te d Phone "; 
}
if( !e mpt y($ phone _ alt) ){
   $sql   = "U P DATE _MAIN_met a  SET meta_pho n e_ a l t= ? WH ERE  meta_user=?;" ; 
   $st m t  = prepa red_Q ue r y( $ con, $sql, [$phone_ al t, $ui d]);    $stmt   - > close();   echo " Upda t ed Alt. Phone";
} 
$con  -> close( ) ;

As yo u can  probabl y tell Ir e peat tha t l ast  fu nct i o nover and over a gain ,and itsee ms sill y t o r untha t$stmt rep eatedlywh en  i tcou ld be accompli sh edwi tha sin g le exe cute.  Fro mwh a t I 've lea r nt i n my  t im e wi thPH P and  pro g ram ming fu ndamental s,t hisis  v ery WET  code, whereTis no long er  tw ice bu t 6x too m uch.  In an attempt tos olve th isissue  I c reated an  ar ray, t hen foreac h inpu t tha twas s et; a d d  t heco lumn namet o  th at ar ra y. Once fi nished implode the arr ay using a co mma  sep a r at or.  F i nal ly cre a t e the SQL state ment using  t h at  implodeda rra y. 
This o utputsa dyn a mically  built SQ L stateme nt  bas e d  on  whateverinputs a re set. S o ifC it y and  Ad dress
(!empty($city)){
 _ _$sql   _= "UPDATE__MAIN_meta_SET meta_city_=?_WHERE meta_user =?;";
_  _$stmt   =_prepared_Query($con, $sql, [$city,_$uid]);
_   $stmt   -> close();
    echo "Updated City";
}
if(!empty($addr)){
__ _$sql__  = "UPDATE _MAIN_meta_SET meta_addr =? WHERE meta_user_=?;";
 _  $stmt   = prepared_Query($con, $sql,_[$addr,_$uid]);
  _ $stmt   -> close();
   _echo "Updated Address";
}
if(!empty($code)){
   _$sql  __=_"UPDATE _MAIN_meta SET meta_code_=? WHERE meta_user =?;";
  _ $stmt   = prepared_Query($con,_$sql, [$code, $uid]);
    $stmt_  -> close();
  _ echo "Updated Postal Code";
}
if(!empty($phone)){
_ _ $sql   _= "UPDATE _MAIN_meta_SET meta_phone_=? WHERE meta_user_=?;";
    $stmt _ = prepared_Query($con,_$sql, [$phone, $uid]);
   _$stmt_  ->_close();
__ _echo "Updated Phone";
}
if(!empty($phone_alt)){
__ _$sql_   = "UPDATE _MAIN_meta_SET_meta_phone_alt =? WHERE meta_user =?;";
  _ $stmt  _=_prepared_Query($con, $sql, [$phone_alt, $uid]);
_   $stmt _ -> close();
   _echo "Updated_Alt. Phone";
}
$con_-> close();

As you can probably tell I repeat that last function_over and over again, and it_seems silly to run_that $stmt_repeatedly_when it could_be_accomplished with_a single execute. From what I've learnt_in my_time with PHP and programming fundamentals,_this is very WET_code,_where T is no longer twice_but 6x too much.  In_an attempt to solve this_issue_I_created an array, then foreach_input that was set; add the_column name to_that array.  Once finished implode the_array_using a comma separator.  Finally_create_the SQL statement using that imploded_array.
This_outputs_a dynamically built SQL statement_based on whatever inputs are set._ So if City and Address