Hola aqui lo envio todo
Código PHP:
$linea1="SELECT *, YEAR(fechaf) as yearOnly FROM salones GROUP BY yearOnly";
$consulta=$linea1;
if ( ! $link=mysql_connect('localhost','user','1234.'))
{
echo "<a href=principal.htm>Error al conectar</a>";
exit ;
}
if ( ! mysql_select_db("base"))
{
echo "<a href=principal.htm>Error al seleccionar BDD</a>";
exit;
}
if ( ! $result=mysql_query($consulta,$link))
{
echo "<a href=principal.htm>Error en la consulta</a>";
exit;
}
echo "<TABLE BORDER=0>";
echo "<TR><table rows='1' rules=rows cellpadding='2' bordercolor='#c0c0d9'>
<TD width=50 align=left class=cuadro><B><I>Desde</I></B></TD>
<TD width=80 align=left class=cuadro><B><I>Hasta</I></B></TD>
<TD width=100 align=left class=cuadro><B><I>Ciudad</I></B></TD>
<TD width=100 align=left class=cuadro><B><I>Pais</I></B></TD>
<TD width=200 align=left class=cuadro><B><I>Nombre</I></B></TD>
<TD width=240 align=left class=cuadro><B><I>Web</I></B></TD>
</TR>";
$result = mysql_query("SELECT *, date_format(fechaf,'%d/%m/%Y' ) as fechaf_es FROM salones where fechaf >= (DATE_FORMAT(DATE_ADD(NOW(), INTERVAL 0 DAY),'%Y-%m-%d')) order by fechaf asc");
while ($row = mysql_fetch_object($result))
{
echo "<table rules=rows $camcolor='$bgcolor' cellpadding='2' bordercolor='#c0c0d9' onmouseover=\"this.style.background='#cacaf3'\" onmouseout=\"this.style.background='$e6e2dd'\">";
echo "<tr>";
//Función para poner la hora con formato 12:00
echo "<td width='50' align='center'>$row->fechai</td";
echo "<td width='80' align='center'>$row->fechaf_es</td>";
echo "<td width='100' align='left'>$row->ciudad</td>";
echo "<td width='100' align='left'>$row->pais</td>";
echo "<td width='200' align='left'>$row->nombre</td>";
//echo "<TD width=240 align=left>$row->web</TD>";
echo "<td width=40 align='left'><a href=".$row['web'].">".$row['web']."</a></td>";
echo "</TR>";
}
mysql_free_result($result);
echo "</table>";
mysql_close($link);
?></td>
</tr>
</table>
</body>
</html>
Muchas gracias