i serialized form to populate the $_POST variable and insert all form varibale as a key and value to mysql
foreach ($_POST as $key => $val){
if (!empty($val)){
$fields[] = "`".$key."` = '".$val."'";
$sql = "UPDATE `$table` SET ".implode(', ',$fields)." WHERE `$idname` = '$idval'";
}
}
then the probleme is $_POST var cannot contain if form has input type="file"
here the forms
<form class="needs-validation mb-0" novalidate id="form" enctype="multipart/form-data" method="post">
<input type="text" name="full_name" />
<input type="file" name="photo" />
<textarea name="address"></textarea>
<button type="submit">Submit</button>
</form>
how to check if form contain file because sometime in other form there is no input file and submit is working but when form has input file the value is empty.. how to check that and change the array to insert and upload the file
can anyone help me please.. thanks..