I try using isset and empty() to go through options, but the output i get is not consistent. The text "Account name was UPDATED!"
from the part
echo 'Account name was UPDATED!';
is what gets repeatedly printed out. Could you please help so that this "if" selection works well
if(isset($_POST['Send'])){
if(!empty($_POST['accttype_name']) || empty($_POST['accttype_interest']) ){
$sql = "UPDATE accounttype SET accounttype_name='".$_POST['accttype_name']."' WHERE accounttype_id = '".$_POST['accttype_id']."' ";
mysql_query($sql);
echo 'Account name was UPDATED!';
}
else if(empty($_POST['accttype_name']) || !empty($_POST['accttype_interest']) ){
$sql = "UPDATE accounttype SET accounttype_interest='".$_POST['accttype_interest']."' WHERE accttype_id = '".$_POST['accttype_id']."' ";
mysql_query($sql);
echo 'Account Interest was UPDATED!';
}
else if(!empty($_POST['accttype_name']) || !empty($_POST['accttype_interest']) ){
$sql = "UPDATE accounttype SET accounttype_name='".$_POST['accttype_name']."', accounttype_interest='".$_POST['accttype_interest']."' WHERE accttype_id = '".$_POST['accttype_id']."' ";
mysql_query($sql);
echo 'Account Name and Interest were UPDATED!';
}
}