I have an article news script which work smoothly in my localhost but have some problems when running in online server. The problems are:
The following code (code to display full text of articles) create blank page:
<?
if (isset($GET['a_id']))
{
//$aa=$GET['a_id'];
$aa=mysql_real_escape_string($_GET['a_id']);
//$result1 = mysql_query("SELECT FROM articles where a_id=$a_id");
$result1 = mysql_query("SELECT FROM articles WHERE a_id ='$a_id'") or die( mysql_error() );
$b=0;
$num=mysql_num_rows($result1);
while($row=mysql_fetch_object($result1))
{$b++;
$a_id=$row->a_id;
$a_title=$row->a_title;
$a_image=$row->a_image;
$a_date=strtotime($row->a_date);
$a_link=$row->a_link;
$a_desc=$row->a_desc;
$a_ldesc=$row->a_ldesc;
}
?>
<p><?=$a_title?></p>
<p><?=$a_link?><</p>
<p><?=$a_desc?><br><br>
<? }?></p>
WHERELSE this code (code to display list of articles) is working fine:
<?
include ("paging.inc.php");
$limit=20;
$query = "SELECT * FROM articles";
$query=paging_1($query,"","0%");
$result=mysql_query($query);
$num=mysql_num_rows($result);
$c=$offset+1;
while($row=mysql_fetch_array($result))
{$b++;
$a_id=$row['a_id'];
$a_title=$row['a_title'];
$a_image=$row->a_image;
$a_date=strtotime($row->a_date);
$a_link=$row->a_link;
$a_desc=$row['a_desc'];
$a_ldesc=$row['a_ldesc'];
?>
<p><?=$a_title?></p>
<p><?=$a_ldesc?><</p>
<p><a href="articles_list.php?a_id=<?=$a_id?>">Read more</a><br><br>
<? }?></p>
AND the following code also (code to dispaly the title, summary, and link to full text articles) is 100% working:
<?
$result1 = mysql_query("SELECT * FROM articles where a_featured='Y'");
$b=0;
$num=mysql_num_rows($result1);
while($row=mysql_fetch_object($result1))
{$b++;
$a_id=$row->a_id;
$a_title=$row->a_title;
$a_image=$row->a_image;
$a_date=strtotime($row->a_date);
$a_link=$row->a_link;
$a_desc=$row->a_desc;
$a_ldesc=$row->a_ldesc;
?>
<p><?=$a_title?></p>
<p><?=$a_ldesc?><</p>
<p><a href="articles_list.php?a_id=<?=$a_id?>">Read more</a><br><br>
<? }?></p>
You can download the script here: www.rodzi.net/i/i.zip
Please help me.