I used the following code, but the required else statement (at the bottom) is not working ,why?I am trying to echo"make is required" when the make input is empty.
if ( isset($_POST['make']) && isset($_POST['year']) && isset($_POST['mileage'])){
if(is_numeric($_POST['year'])&&is_numeric($_POST['mileage']){
$sql = "INSERT INTO autos (make,year, mileage) VALUES (:make, :year, :mileage)";
$stmt = $pdo->prepare($sql);
$stmt->execute(array(
':make' => $_POST['make'],
':year' => $_POST['year'],
':mileage'=> $_POST['mileage']));
}
else
echo"Year and mileage should be numeric";
}
else
echo"make is required";//Not working