He creado el siguiente código para que se muestren las diferentes titulares con su correspondiente vínculo a la noticia, intentando pasar la variable $datos[titular] a "muestranoticia.php", y que esta página muestre el titular, noticia y la fecha en la que se escribió ésta. Codigo: <? include("configarchivonoticias.php") ; $resp = mysql_query("select * from archivonoticias order by fecha desc") ; while($datos = mysql_fetch_array($resp)) { $fecha = ($datos[fecha]) ; ?> <p>> <? echo "<a href='muestranoticia?amostrar=$datos[titular]'><strong>$datos[titular]</a></strong> "; echo "("; echo $fecha; echo ")<br>"; ?> </p> <p> <? } mysql_close(); ?></font> </p> Y éste el de la página que debería mostrar la noticia elegida: Codigo: <? include("configarchivonoticias.php") ; $id=$_GET['amostrar']; $resp = mysql_query("select fecha, titular, noticia from archivonoticias WHERE amostrar=$id") ; while($datos = mysql_fetch_array($resp)) { $fecha = ($datos[fecha]) ; ?> <table width="524" height="95" border="0" align="center" bgcolor="#FFFFFF"> <!--DWLayoutTable--> <tr> <td height="28" colspan="2" valign="top"> <div align="left" style="background-image: url(Noticias/noticiaestrecha.gif); width:516px; height:24px"> <p><strong><font color="#FFFFFF"> <? echo $datos[titular] ?></font></strong></p> </div></td> </tr> <tr> <td width="100" height="23" valign="top" style="border-style:solid; border-width:0px; padding:0; "> <div align="left" style="background-image: url(Noticias/fecha.gif); width:95px; height:19px"><strong><font color="#FFFFFF" size="2"> <? echo $fecha ?></font></strong></div></td> <td width="416"> </td> </tr> <tr bordercolor="#000000"> <td height="44" colspan="2" valign="top" style="border: 1px solid #0000FF"> <font color="#000000"><? echo $datos[noticia]; ?></font></td> </tr> </table> <p><font color="#000000"> <? } mysql_close(); ?> Me da el siguiente error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\archivos de programa\apache group\apache\htdocs\noticias\muestranoticia.php on line 23 |
Cambia esto: |
Muchas gracias, me va perfecto |
Bueno pues suerte! |
Por alguna razón inesperada ahora no me va en miarroba, sólo en localhost. |
básicamente, caida de mysql... ara si funciona... |
AAAAAAA YA SE! |
Qué fallo más tonto, |
Bueno, igual era por el apache... |
xD |
Escrito originalmente por ivanitoweb xD que fallo más tonto! buno, en fin... Bye. ????????? No es una afirmación, es una pregunta |
mmm pues tendrias que poner su ekivalente en html o algo parecido... Bye. |
Su equivalente en html? |
Bueno, en ves de poner tal=cual |
Pues no lo puedo poner directamente porque entonces no funcionaría el sistema de la página. |
Como que porque no me conecto? |
eso es igual!!! |
ATENCIÓN: Este tema no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un nuevo tema en lugar de responder al actual |
Opciones: Ir al subforo: |
Permisos: TU NO PUEDES Escribir nuevos temas TU NO PUEDES Responder a los temas TU NO PUEDES Editar tus propios mensajes TU NO PUEDES Borrar tus propios mensajes |
Temas similares | ||||
Tema | Usuarios | Respuestas | Visitas | Actividad |
---|---|---|---|---|
Por: EnolEo, el 10/Ene/2012, 21:01 | 2 | 2k | Jan/12 | |
Por: stiwielegrand, el 19/Feb/2011, 14:48 | 7 | 2k | Mar/11 | |
Por: ligoverto, el 14/Ene/2010, 19:22 | 2 | 2k | Jan/10 | |
Por: Habboparceros, el 10/Dic/2009, 00:14 | 7 | 2k | Dec/09 | |
Por: ligoverto, el 20/Jun/2009, 20:23 | 5 | 3k | Jun/09 |