Hello guys,
My first little news script is working fine, now
I'm displaying a title and time with a link to read the news (more...)
But I would also like to display a litle text under the title (2 lines)
but how do I have to do this?
This is my display script for the user:
<html>
<head>
</head>
<body>
<ul>
<?php
require_once ('../head.php');
// includes
include('../conf.php');
include('../functions.php');
$connection = mysql_connect($host, $user, $pass) or die ('Connection failed!');
mysql_select_db($db) or die ('Database offline!');
$query = "SELECT id, title, timestamp FROM news ORDER BY timestamp DESC LIMIT 0, 5";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
if (mysql_num_rows($result) > 0)
{
while($row = mysql_fetch_object($result))
{
?>
<p>
<li><strong><?php echo $row->title; ?></strong>
<br/>
Message placed on:
<?php echo formatDate($row->timestamp); ?>
</li>
<br/>
<a href="story.php?id= <?php echo $row->id; ?>">More...</a>
</p>
<?php
}
}
else
{
?>
<strong><h1>No news</h1></strong>
<?php
}
mysql_close($connection);
?>
</ul>
</body>
</html>
Thank you,