[CODE]
<?php
$sql=@mysql_query("select var1, var2, var3 from tablename ");
if(!$sql)
{
die('Can not perform query!');
}
while ( $row = @mysql_fetch_array($sql) )
{
$var1=strip_tags(stripslashes($row['var1']));
$var2=substr(strip_tags(stripslashes($row['var2'])),0,150);
$var3=$row['var3'];
// substr in this case takes first 150 chars from
//the var2 (in this case some text)
}
echo ('' .$var1 .'');
echo(''.$var2.'');
echo (' <a href="news.php?readmore='.$var3.'"> Full Paper </a>');
//var1 news name
//var2 news text (the first 150 chars we extracted before)
//var3 news id , we have to pass it to the next page
?>
[/CODE]