For each value that you want to check:
$errors = 0;
$error_msg = '';
if (!isset($_POST['fname']) || empty ($_POST['fname']))) { $errors++: $error_msg = 'Errors Text'; }
// And so on for each posted field you want to check and then echo out the errors in the page
if ($errors ==0) {
// Run your insert / update querry
}