error in my IF
Posted: Thu Nov 17, 2005 2:38 am
my code is supposed to unly change a field if there is a value in it.
i dont know what the error is ... i get the parse: T_CONSTANT_ENCAPSED_STRING
for the line: $sql = "WHERE eqdes ='" .$_POST['eqdes']."'";
I changed it over and over ...
plz help i dont know what to do!!!
i dont know what the error is ... i get the parse: T_CONSTANT_ENCAPSED_STRING
for the line: $sql = "WHERE eqdes ='" .$_POST['eqdes']."'";
Code: Select all
$params = array();
if ($_POST['groupp'] != '') {
$params['groupp'] = $_POST['groupp'];
}
if ($_POST['beschreibung'] != ''){
$params['beschreibung'] = $_POST['beschreibung'];
}
if (count($params)) {
$sql = "UPDATE sam_artikel SET ";
foreach ($params as $key=>$val) {
$sql = "$key = '''.$val."', ";
}
$sql = substr($sql, 0, -2);
$sql = "WHERE eqdes ='" .$_POST['eqdes']."'";
mysql_query($sql);
}plz help i dont know what to do!!!