Parse error: syntax error, unexpected 'else' (T_ELSE), on line 26?

0

Says I have an error in analysis in the else but I do not see error, can you help me?

<?php
$conn = new mysqli("localhost","root","","antetodopopayan");

$sql = "UPDATE informacion SET estado = 1 WHERE estado = 0";    
$result = mysqli_query($conn, $sql);

$sql = "SELECT * FROM informacion ORDER BY id_informacion DESC limit 5";
$result = mysqli_query($conn, $sql2);

$sql2 = "UPDATE afiliados SET estado = 1 WHERE estado = 0";
$sql2 = "SELECT * FROM afiliados ORDER BY id DESC limit 5";
$result2 = mysqli_query($conn, $sql2);

$response='';

while($row=mysqli_fetch_array($result)) {

    $fechaOriginal = $row["fecha"];
    $fechaFormateada = date("d-m-Y", strtotime($fechaOriginal));

    $response = $response . "<div class='notification-item'>" .
    "<div class='notification-subject'>". $row["asunto_info"] . " - <span>". $fechaFormateada . "</span> </div>" . 
    "<div class='notification-comment'>" . $row["nombre_info"]  . "</div>" .
    "<div class='notification-comment'>" . $row["mensaje_info"]  . "</div>" .
    "</div>";
}else{
    while($row=mysqli_fetch_array($result2)) {

        $fechaOriginal = $row["fecha"];
        $fechaFormateada = date("d-m-Y", strtotime($fechaOriginal));

        $response = $response . "<div class='notification-item'>" .
        "<label>Nuevo afiliado</label>".
        "<div class='notification-subject'>". $row["nombre"] . " - <span>". $fechaFormateada . "</span> </div>" . 
        "<div class='notification-comment'>" . $row["correo"]  . "</div>" .
        "</div>";
    }
}


if(!empty($response)) {
    print $response;
}


?>
    
asked by Stiven 28.12.2018 в 17:06
source

0 answers