0

Hi guys , how is everything ?.
I have got a small problem on the datas which are coming from my database . Ok it is not a real problem .
A part of my website do contain some articles and i want to view only the titles of the articles, that is easy but the problem now i want when someone clicks on the title i want only that article to be loaded in the page articles.php so how can i do that ?

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by vibhaJ
0

lets say list.php is a page where all article title are shown.

<?
	$q="select * from article";
	$rs = mysql_query($q);
	while($sar = mysql_fetch_assoc($rs))
	{
?>
	<a href="article.php?aid=<? echo $sar['id'];?>"><? echo $sar['title'];?></a>
<?
	}
?>

When user click on that title you can redirect user to article.php with some unique id. and on article.php page you can show article.

<?
	$aid = $_REQUEST['aid'];
	$q="select * from article where id =".$aid;
	$rs = mysql_query($q);
	$sar = mysql_fetch_assoc($rs);	
?>
Title : <? echo $sar['title'];?>
Article : <? echo $sar['article_description'];?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.