500000) {
echo "Please enter a file size between 5mb";
$upload_ok = 0;
} else { //
//Allow certain file formats
if($img_file_type != "jpg" && $img_file_type != "png" && $img_file_type != "jpeg" && $img_file_type != "gif") {
//echo "JPG, PNG, JPEG and GIF files are allowed";
$upload_ok = 0;
} else {
//Check if $upload_ok is set to 0 by an error
if($upload_ok === 0) {
echo "File has not been uploaded";
} else {
if(move_uploaded_file($temp_file_name, $target_file)){
$db_query = "UPDATE expert set expert_id = '$expert_id', personal_id = '$personal_id', name = '$name', title = '$title', picture = '$target_file', major = '$major', tel = '$tel', tel_count = '$tel_count', chat_id = '$chat_id', chat_count = '$chat_count', video_call = '$video_call', video_count = '$video_count', onsite_call = '$onsite_call', onsite_count = '$onsite_count', create_at = '$create_at' WHERE id='$id'";
mysqli_query($link, $db_query);
}
}
}
}
}
$affected = mysqli_affected_rows($link);
mysqli_close($link);
if ($affected > 0) {
echo "";
} elseif ($affected == 0) {
echo "";
} else {
echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link);
}
}
?>