Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/02/2012, 01:37
Avatar de protoameeba
protoameeba
 
Fecha de Ingreso: septiembre-2005
Mensajes: 195
Antigüedad: 18 años, 8 meses
Puntos: 3
De acuerdo Problema con array

Buenas amigos,

Tengo un problema con un array:

Código PHP:
Ver original
  1. $result = mysql_query("SHOW TABLE STATUS FROM xxx;");
  2. while($array = mysql_fetch_array($result)) {
  3. $cadena = "$array[Name]";
  4. if (preg_match ("/album_/", $cadena))
  5. {
  6. $mar=  " UNION ALL SELECT votos, portada FROM " . $cadena;
  7. $_SESSION["albumesRanking"] = $mar;
  8. echo "$arrayEnd";
  9. }
  10. }

vale, hasta ahi bien, esto me imprime:

UNION ALL SELECT votos, portada FROM album_a UNION ALL SELECT votos, portada FROM album_aaa UNION ALL SELECT votos, portada FROM album_bas UNION ALL SELECT votos, portada FROM album_firmo66 UNION ALL SELECT votos, portada FROM album_guillermoylu UNION ALL SELECT votos, portada FROM album_real

hasta aqui todo va de lujo, pero es que despues, hago lo siguiente:

Código PHP:
Ver original
  1. $resultado=mysql_query('SELECT votos, portada FROM album_real '.$arrayEnd.' ORDER BY votos DESC LIMIT 3');
  2. while ($array = mysql_fetch_array($resultado) ) {
  3. $portada = $array[portada];
  4. $votos = $array[votos];
  5. echo "<img src='$portada'/>";
  6. echo "<br/>";
  7. }
  8.  
  9.  
  10.  
  11. echo "$arrayEnd";


y no funciona, es decir solo pilla las portadas del primer album, y al imprimir el $arrayEnd, efectivamente no me imprime toda la cadena del array, si no solo el primer valor...

UNION ALL SELECT votos, portada FROM album_real


Mi pregunta es:
Sabe alguien como puedo hacer para que la variable $arrayEnd contenga toda la informacion???

Gracias!
__________________
Ser libre no es hacer lo ke uno kiere, sino kerer lo ke uno hace....