By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,064 Members | 1,445 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,064 IT Pros & Developers. It's quick & easy.

help in PHP : about LINKS INDEX.

P: 1
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3.  
  4. <?php
  5. $con = mysql_connect("localhost","root","");
  6. if (!$con)
  7.   {
  8.   die('Could not connect: ' . mysql_error());
  9.   }
  10.  
  11. mysql_select_db("revsubdb", $con);
  12.  
  13. $result = mysql_query("SELECT * FROM recs");
  14.  
  15. echo "<table border='0' width='' id='topak'>
  16.  
  17. <tr>
  18. <th>Subject Code</th>
  19. <th>Description</th>
  20. <th>Profesor</th>
  21. </tr>";
  22.  
  23. while($row = mysql_fetch_array($result))
  24.   {
  25.   $secode = $row['secode'];
  26.  
  27.   echo "<tr>";
  28.   echo "<td>" . $row['secode'] . "</td>";
  29.   echo "<td>" . $row['secdesc'] . "</td>";
  30.   echo "<td>" . $row['prof'] . "</td>";
  31.   echo "</tr>";
  32.  
  33.   }
  34. echo "</table>";
  35.  
  36. mysql_close($con);
  37. ?>
  38. </body>
  39. </html>
How can i echoed it out in links and when its clicked it will display the data only form that link.


TIA!!!
Jan 20 '12 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,366
Surround what you want to be linked in anchor tags. Have those anchor tags go to a page and pass a unique id through get. That page will then use the unique id passed to display just that data.
Jan 20 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.