PDA

View Full Version : auto updated links



ketanco
29 Apr 2008, 01:37 PM
Hi all,
The query below brings three results. I also want a link at the end of each result for "Read More" to be updated automatically based on the id of the displayed reult. Then I will get that id in another page, to display the corresponding article.
table is like this: id, date, title, par1
The problem is the syntax of the last line. It is not working. I need to transfer this id to another page. Can anybody tell me what is the syntax error here? Or if this is not good, how can I achieve transferring this id when clicked to another page?
The rest of the code was working, displaying three results properly, before the last line was there. But I need that auto updated link too.
$query=mysql_ query("select * from newsa ORDER BY id DESC LIMIT 3");
while ($row = mysql_fetch_ array($query) )
{
echo"<p class='newstitle1' >" . $row['date'] ."<br/>". $row['title' ] . "</p>".
"<p id=newstext1> " . $row['par1'] ."</p>".
"<a href=" whole article.php? id=<?= $row['id'] ?>">"."(Read more...)"."< /a>" ; }

kb0000
30 Apr 2008, 07:01 AM
Hi all,
The query below brings three results. I also want a link at the end of each result for "Read More" to be updated automatically based on the id of the displayed reult. Then I will get that id in another page, to display the corresponding article.
table is like this: id, date, title, par1
The problem is the syntax of the last line. It is not working. I need to transfer this id to another page. Can anybody tell me what is the syntax error here? Or if this is not good, how can I achieve transferring this id when clicked to another page?
The rest of the code was working, displaying three results properly, before the last line was there. But I need that auto updated link too.
$query=mysql_ query("select * from newsa ORDER BY id DESC LIMIT 3");
while ($row = mysql_fetch_ array($query) )
{
echo"<p class='newstitle1' >" . $row['date'] ."<br/>". $row['title' ] . "</p>".
"<p id=newstext1> " . $row['par1'] ."</p>".
"<a href=" whole article.php? id=<?= $row['id'] ?>">"."(Read more...)"."< /a>" ; }

You can try some a script located at: scripts.thomain.com
The script is about picture gallery management. Here you can get the ID updation at the end of the result page.
Hope you will get help from it