Hello,
There are two files. The first one displays correctly and then it displays the link to all the entries in the table such as:
file1:
//this is to display the most recent entry entirely
$query=mysql_query("select * from table1 ORDER BY id1 DESC LIMIT 1");
echo $row['description1']. $row['text1']; }
//this is to display the links only to most recent 50 entries. upon click user should be directed to the particular entry to see it a sa whole...
$query=mysql_query("select * from table1 ORDER BY id1 DESC LIMIT 50");
$b=$row['id1'];
while ($row = mysql_fetch_array($query)) {echo "<a href='file2.php?id1=$b'>".$row['name1']."</a>"; }
file2:
$id = $_GET['id1'];
$query=mysql_query("select * from table1 WHERE id1=$id");
while ($row = mysql_fetch_array($query)) {
echo $row['description1']. $row['text1']; }
$query=mysql_query("select * from table1 ORDER BY id1 DESC LIMIT 50");
$b=$row['id1'];
while ($row = mysql_fetch_array($query)) {echo "<a href='file2.php?id1=$b'>".$row['name1']."</a>"; }
Problem is, after user clicks the link "name1" it gives an error for the line written with red. it says it is not a valid mysql result resource. Please help.
Note: To make it clear, when user clicks the link on file 1, he goes to file 2 and from then on, he should stay in file 2, even if he clicks a link in file 2, it refers it back to itself as in the last line. File 1 is only when the user comes to that page for the first time. After he clicks one of the other entry links, it becomes file 2 and shoudl display eveything the same way. But it doesnt, it gives error.