Is this considered "bad practice" to create such a function:
// $arr_member_fields['first_name'] = $_POST['first_name'];
// $arr_member_fields['last_name'] = $_POST['first_name'];
// $arr_member_fields['email'] = $_POST['email'];
// $arr_member_fields['dob'] = $_POST['dob'];
// $arr_member_fields['gender'] = $_POST['gender'];
function update_member($int_member_id $arr_member_fields)
{
//some code
}
Or you need to create a function without an array and just use variables - for example:
function update_member($int_member_id, $str_first_name, $str_last_name, str_email, $str_dob, $chr_gender)
{
}
The reason I prefer the first method (the one that has an array) is that I always have the ability to iterate over the array to insert / update the database.
It is very curious to know other peoples in this regard.
source
share