Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/11/2011, 12:14
Avatar de pampa_
pampa_
 
Fecha de Ingreso: mayo-2006
Mensajes: 334
Antigüedad: 18 años, 10 meses
Puntos: 1
hacer anuncios deslizantes!!!

Hola!!

Estoy intentando hacer un anuncio deslizante con php, es un rollo y la verdad es que ya me estoy empezando a saturar, asi que he decidido hacer un apaño que me sirva....

Sacaria los datos de una anuncio y los guardaria en un array multidimensional de php.
Código PHP:
Ver original
  1. $link = mysql_connect("fd.com", "anuncios", "1234");
  2.         mysql_select_db("anuncios", $link);
  3.            
  4.         $consulta = mysql_query("SELECT id_anuncio FROM anuncios order by id_anuncio desc limit 3", $link);
  5.        
  6.         $id_ult_anuncio = mysql_fetch_assoc($consulta);
  7.        
  8.  
  9.  
  10.         // CODIGO PARA BUSCAR SI HAY UN ERROR EN LA CONSULTA
  11.         $error = mysql_error($link);  // $link es la variable de conexión
  12.            
  13.         if ($error!=null)
  14.         {
  15.             print("Ocurrio; el Siguiente Error:\n ".$error);
  16.             exit;
  17.         }
  18.         // FIN DE LA BUSQUEDA DE ERROR
  19.                    
  20.         $i=0;
  21.  
  22.         $result=$id_ult_anuncio['id_anuncio'];
  23.                
  24.         if($result!=""){
  25.         while ($i<3){  
  26.         $result=$id_ult_anuncio['id_anuncio'] - $i;
  27.         $result = mysql_query("SELECT * FROM anuncios WHERE id_anuncio=$result", $link);
  28.         while ($row = mysql_fetch_row($result)){
  29.             $mayusculas = strtoupper ($row[2]);
  30.             $preciomayusculas= strtoupper ($row[15]);
  31.             $categoriamayusculas=strtoupper ($row[17]);
  32.  
  33.             $miarray=array($i=>array(0=>$row[4], 1=>$mayusculas, 2=>$preciomayusculas, 3=>$categoriamayusculas));

El primer problema es que no puedo sacar una imagen que este en un array multidimensional, vamos que no se como hacerlo.

Código PHP:
Ver original
  1. echo '<table align="center" border="0" cellpadding="5" cellspacing="0" class="caja">';
  2.             echo "<tr>";
  3.                 echo "<th rowspan='3' scope='row'><img width='178' height='150' src='.$miarray[2][0].'></img></th>";
  4.                 echo "<td rowspan='3' width='15' height='10'></td>";
  5.                 echo "<td width='504' height='50' style='font-family:arial;color:white;font-size:28px;'><b>$mayusculas</b></td>";
  6.                 echo "<td rowspan='2'></td>";
  7.             echo "</tr>";
  8.             echo "<tr>";
  9.                 echo "<td colspan='2' valign='top' style='font-family:arial;color:white;font-size:16px;'><i>$row[3]</i></td>";
  10.             echo "</tr>";
  11.             echo "<tr height='30'>";
  12.                 echo "<td width='98' valign='bottom' style='font-family:arial;color:white;'>$categoriamayusculas</td>";
  13.                 echo "<td width='190' valign='bottom' style='font-family:arial;color:white;font-size:14px;'><b>Precio: $preciomayusculas&euro;</b></td>";
  14.             echo "</tr>";
  15.             echo '</table>';
  16.             echo '</br>';
en $miarray[2][0] no me funciona...

otra cosa que busco seria hacer que una vez guardados los datos en el array de los ultimos 3 anuncios, cada cierto tiempo se mostraran los datos del primer anuncio y luego al tiempo los del segundo y asi sucesivamente.....


Me podeis ayudar/guiar?