PHP ver gevorderde |
|
Zo misschien, heb t ni getest:
<?php
$velden = array("naam", "email", "woonplaats", "land", "intresses");
foreach($velden as $veld)
mysql_query("UPDATE personal SET ".$veld." = '".((empty($veld) || $veld == "") ? "---" : $_POST[$veld])."' WHERE userid = '".$_SESSION['userid']."'")
?>
<?php $velden = array("naam", "email", "woonplaats", "land", "intresses"); foreach($velden as $veld) mysql_query("UPDATE personal SET ".$veld." = '".((empty($veld) || $veld == "") ? "---" : $_POST[$veld])."' WHERE userid = '".$_SESSION['userid']."'") ?>
|