Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/06/2014, 21:14
pablos_cent
 
Fecha de Ingreso: junio-2012
Mensajes: 53
Antigüedad: 11 años, 10 meses
Puntos: 1
Problema con if, elseif, else

Hola, tengo problemas para abrir y cerrar los if y elseif, abro el primer if y luego no puedo continuar con un elseif y me da error, lo tengo asi:

Código PHP:
Ver original
  1. <?php
  2.   // Perfil de los usuarios registrados
  3.     $Usuario = mysql_query("SELECT * FROM ".$db_users." WHERE id_usuario='".$_GET['user']."'") or die(mysql_error());
  4.     if(mysql_num_rows($Usuario)) {
  5.  
  6.   // Buscamos los datos a mostrar del usuario
  7.     $InfoUser = mysql_fetch_array($Usuario);
  8.     $id_usuario = $InfoUser["id_usuario"];
  9.     $nick = $InfoUser["nick"];
  10.     $rango = $InfoUser["rango"];
  11.     $email = $InfoUser["email"];
  12.     $avatar = $InfoUser["avatar"];
  13.     $pais = $InfoUser["pais"];
  14.     $nombre = $InfoUser["nombre"];
  15.     $apellidos = $InfoUser["apellidos"];
  16.     $sexo = $InfoUser["sexo"];
  17.     $envelope = $InfoUser["envelope"];
  18.     $bg_image = $InfoUser["bg_image"];
  19.     $bg_repeat = $InfoUser["bg_repeat"];
  20.     $bg_position_x = $InfoUser["bg_position_x"];
  21.     $bg_color = $InfoUser["bg_color"];
  22.     $border_style = $InfoUser["border_style"];
  23.     $border_color = $InfoUser["border_color"];
  24.     include'ProfileView.php';
  25.     }
  26.  
  27.   // Perfil propio del usuario
  28.     $perfil = mysql_query("SELECT * FROM ".$db_users." WHERE id_usuario='".$_GET['profile']."'") or die(mysql_error());
  29.     if(mysql_num_rows($perfil)) {
  30.  
  31.   // Obtenemos los datos a mostrar del usuario
  32.     $InfoUser = mysql_fetch_array($perfil);
  33.     $id_usuario = $InfoUser["id_usuario"];
  34.     $nick = $InfoUser["nick"];
  35.     $rango = $InfoUser["rango"];
  36.     $email = $InfoUser["email"];
  37.     $avatar = $InfoUser["avatar"];
  38.     $pais = $InfoUser["pais"];
  39.     $nombre = $InfoUser["nombre"];
  40.     $apellidos = $InfoUser["apellidos"];
  41.     $sexo = $InfoUser["sexo"];
  42.     $envelope = $InfoUser["envelope"];
  43.     $bg_image = $InfoUser["bg_image"];
  44.     $bg_repeat = $InfoUser["bg_repeat"];
  45.     $bg_position_x = $InfoUser["bg_position_x"];
  46.     $bg_color = $InfoUser["bg_color"];
  47.     $border_style = $InfoUser["border_style"];
  48.     $border_color = $InfoUser["border_color"];
  49.     include('ProfileUser.php');
  50.     }
  51.  
  52.   // Página de lista de usuarios registrados
  53.     elseif($_GET['page'] == 'users') {
  54.       include'ListUsers.php';
  55.     }
  56.  
  57.   // Inicio de la página de usuarios
  58.     else {
  59.       $sQl = mysql_query("SELECT * FROM ".$db_users." order by nombre");
  60.       include'Inicio.php';
  61.     }
  62. ?>

Hay dos if:
if(mysql_num_rows($Usuario)) {
if(mysql_num_rows($perfil)) {

Luego viene recien el:
elseif($_GET['page'] == 'users') {

y es hay donde se genera el error, alguien me puede ayudar por favor

Última edición por Triby; 15/06/2014 a las 00:45 Razón: Código en highlight