I'm trying to update a particular field in a mysql database. The field name is passed in a var, to a value (also passed in a var) where a specific field (memID) is equal to a particular value (also passed in a var). I'm using '?' placeholders.
function modFiltName($filtID,$newFN,$memID) {
include '../includes/setDBC.php'; //connect to dbc
$stmt=$dbc->prepare('UPDATE mzfilters SET ? = ? WHERE memID=? ');
$stmt->execute(array($filtID,$newFN,$memID));
$dbc=null; // Close connection
}
It seems simple enough but I get errors no matter how I rearrange the code. The last error is typical of what I'm getting: ". . for the right syntax to use near '? = ? WHERE memID=?' " . .