Tema: link
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/01/2009, 04:38
Avatar de josmarxxx
josmarxxx
 
Fecha de Ingreso: enero-2009
Mensajes: 17
Antigüedad: 15 años, 3 meses
Puntos: 0
Exclamación link

<?php
// open connection to MySQL server
$connection = mysql_connect('localhost', 'root', '') or die ('Unable to connect!');
// select database for use
mysql_select_db('bd_novedades') or die ('Unable to select database!');
// create and execute query
$query = 'SELECT * FROM novedades order by fecha desc';
$result = mysql_query($query) or die ('Error in query: $query. ' . mysql_error());
// check if records were returned
if (mysql_num_rows($result) > 0)
{
// print HTML table
echo '<table width=100% cellpadding=10 cellspacing=0 border=1>';
echo
'<tr><td><b>Title</b></td><td><b>fecha</b></td></tr>';
// iterate over record set
// print each field
while($row = mysql_fetch_assoc($result))
{
echo '<tr>';
echo '<td>' .$row['titulo']. '</td>'; ---> COMO HAGO PARA KE ESTO SEA UN LINK
echo '<td>' .$row['fecha']. '</td>';
echo '</tr>';
}
echo '</table>';
}
else
{
// print error message
echo 'No rows found!';
}
// once processing is complete
// free result set
mysql_free_result($result);
// close connection to MySQL server
mysql_close($connection);
?>
</body>
</html>