Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/10/2012, 13:09
Avatar de novamix
novamix
 
Fecha de Ingreso: enero-2007
Ubicación: Getafe, Spain
Mensajes: 50
Antigüedad: 17 años, 3 meses
Puntos: 1
Problema en php endif

el problema esta en el siguiente código donde hago una consulta a mysql. y me sale el siguiente error

Parse error: syntax error, unexpected T_ENDIF in /post_con.php on line 42

no se cual es el fallo haber si me puede colaborar.

Código PHP:
<?php  
    
include_once('../conect.php');

$hoy getdate();
$hoy date("Y-m-d");              
echo 
"$hoy";
?>


   <?php /* verificar la conexión */
        
if (mysqli_connect_errno()) {
                
printf("Conexión fallida: %s\n"mysqli_connect_error());
                exit();
          }

        
$query "SELECT concierto_id, artista, fecha, TIME_FORMAT(hora,'%H:%i') as hora, sala, direccion, localidad, provincia, imagen FROM concierto WHERE fecha=$hoy ";

          if (
$result mysqli_query($conexion$query)) {
              
// SI NO HAY CONCIERTOS

            
if (mysqli_num_rows($result) == 0) {
                 echo 
" No hay conciertos </div> </div></div>";

                 include_once(
'footer.php');
                 exit;
   
              }

         
/* obtener array asociativo */
        
while ($row mysqli_fetch_assoc($result)) {

              
printf ("$row[concierto_id] -  fecha de hoy : $hoy\n");
            }

          
/* liberar el conjunto de resultados */
          
mysqli_free_result($result);
          }   
        
?>
          <?php endif;    mysqli_close($conexion); ?>