I have the script:
From the script I have above, I want to show a litle content of the article. How? How script to I must add into the script above?
Code:
<h1>List Articles</h1>
<?php
// Conection to mysql
require_once ('../connection/class.mysql.php');
$data = new Mysql();
$data->connect();
// query SQL to read all the articles sorted according to its id
$query = "SELECT * FROM newsdb ORDER BY newsid";
$result = mysql_query($query);
while ($data = mysql_fetch_array($result))
{
// display titles of articles and little content of the articlel
echo "<h3><a href='view.php?newsid=".$data['newsid']."'>".$data['title']."</a></h3>";
if(!empty($data['pictures'])){
echo "<P><img align=left width=200px vspace=6 hspace=12 src='../images/".$data['pictures']."'></a>";} echo "<p align=justify>".$data['content']."</p>";
}
?>
Comment