I usually add a prefix and suffix to sanitization/handling convenience.
For example, if a field must contain just letters, and nothing else, i ll name it tx_field_name
, otherwise if can contain filtered html, hf_field_name
or full html hx_field_name
... the script who ll get the form know how to sanitize and check the values in base of the prefix.
But if your meaning is explicity hide the column s name of the database, well, gave it the name you want, foo
, bar
, or add random suffixes, or even replace the _
with -
(that are allowed in html fields name, but not in database column name)
p.s: i hope that you ARE NOT using a code like
$values = $_POST;
$n_val = count($values);
$i = 0;
foreach($values AS $key => $value){
$pairs .= " `$key` = $value ";
if($n_val > $i){
$pairs .= , ;
}
}
thedbyouprefer_query("UPDATE table SET $pairs WHERE id = 42 ");
to handle the form, but mapping it with php (..and a bit of prepared staements wont be bad)