Is there a logical (and possible) way to do something like this?
UPDATE $table SET LIKE %_checkbox = '' WHERE id='$id'
I have fields like allowed_checkbox and types_checkbox and they are sent to the database script dynamically. Can you use a wildcard when referring to the column name?
You’ve got a bit of a Frankenstein syntax there. The server will need to know the table and column names before compiling the SQL – so you can’t do what you’re after directly.
Does your php code have no prior knowledge of the database schema?
The key word you used is dynamically – you could find matching column names using a query against the MySQL INFORMATION_SCHEMA.COLUMNS table. You could do this per-update, which would be expensive, or once at application start up extract the schema for all tables you need.