![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
18/11/2009, 18:02
|
| | Fecha de Ingreso: noviembre-2009
Mensajes: 3
Antigüedad: 15 años, 2 meses Puntos: 0 | |
No se muestran los datos de la consulta en PHP Tengo el siguiente código, en mi PC funciona sin problemas, pero una vez que lo he publicado, no se muestran los resultados de las consultas.
Las caracteristicas de mi hosting son:
- Servidor Web Apache 2.2.4
- Base de datos MySQL 5.2.1
- PHP 5
Este es mi codigo:
<?
include("comun/conexion.php");
$link=OpenConexion();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<
<script language="JavaScript">
function vernew(pagina, idn) {
location.href = pagina + "?idn=" + idn;
}
</script>
</head>
<body bgcolor="#0A1C34" background="images/fondo_iframe.jpg">
<table width="680" border="0" align="center">
<tr>
<td height="30"></td>
</tr>
<tr>
<td colspan="3" height="340" align="center"><img src="images/foto_inicio.jpg" width="675" height="340"></td>
<td width="5"></td>
</tr>
<tr>
<? //ESTO ES LO QUE NO FUNCIONA!
$rs = mysql_query("SELECT idnoticia,fecha, titulo, resumen, foto FROM noticia ORDER BY fecha DESC LIMIT 0,3",$link);
while($arr=mysql_fetch_array($rs)){
echo '<td height="110" align="center"><img src='.$arr['foto'].' height="110" width="225"></td>';
}
?>
<td width="5"></td>
</tr>
<tr>
<? // ESTO ES LO QUE NO FUNCIONA
$sql="SELECT idnoticia,fecha, titulo, resumen, foto FROM noticia ORDER BY fecha DESC LIMIT 0,3";
$rs = mysql_query($sql,$link);
while($arr=mysql_fetch_array($rs)){
?>
<td height="90" align="left" valign="top" class="tdTitulo">
<a href="#" onClick="javascript:vernew('new.php','<?=$arr['idnoticia']?>')">
<B><?=$arr['titulo']?></B>
: </a>
<?=$arr['resumen']?><a href="#" onClick="javascript:window.location='new.php?idn=< ?=$arr['idnoticia']?>'">...Ver Más</a>
</td>
<?
}
?>
<td width="5"></td>
</tr>
<tr>
<td colspan="4" width="5"></td>
</tr>
</table>
</body>
</html> |