I have never done a bind_param()
on a key/value table. So, I'm not sure that CASE WHEN can even be applied this way.
The variable
column holds all those "cust_xxx" items while their actual values sit in the value
column.
Also, I wasn't sure if $who (which is an INT variable) needed bound. Also, I wasn't sure if I should be using sssss or ddddd. They're doubles as entered in the form, but their fields (profile fields on a web forum) are just VARCHAR.
In any case I get the
PHP Fatal error: Uncaught Error: Call to a member function bind_param() on bool
$stmt = $connmember->prepare(" UPDATE smfqg_themes SET
`value` = CASE( WHEN (`variable` = 'cust_novpil') THEN ?
WHEN (`variable` = 'cust_decpil') THEN ?
WHEN (`variable` = 'cust_janpil') THEN ?
WHEN (`variable` = 'cust_febpil') THEN ?
WHEN (`variable` = 'cust_marpil') THEN ?
END)
WHERE id_member = '$who' ");
$stmt->bind_param('ddddd', $novpil, $decpil, $janpil, $febpil, $marpil);
$stmt->execute();