Help me .....

Thread Solved

Join Date: Jun 2008
Posts: 145
Reputation: ishlux is an unknown quantity at this point 
Solved Threads: 0
ishlux ishlux is offline Offline
Junior Poster

Help me .....

 
0
  #1
Jul 22nd, 2008
Hi.....here i am able to display only the last row contents.....pls help me......i want to display the rows based on user selection.....here what ever u select it will disply the last row.....

  1.  
  2. <?php
  3. session_start();
  4.  
  5. include('database.php');
  6. $result = mysql_query("SELECT * FROM autoalto_mail" );
  7.  
  8. while($row = mysql_fetch_array($result))
  9. {
  10. ?>
  11.  
  12.  
  13. <tr><td width="10%"></td>
  14. <td ><img src="images/buldot.gif" alt="" height="6" width="6">
  15. <?echo $row['from']?></td>
  16. <td >
  17. <a href="contractor_mail_action_contents.php?mail_id=<? $mailid=$row['mail_id'];
  18. session_register("mailid");
  19. ?>">
  20.  
  21. <?
  22. session_start();
  23. include('database.php');
  24. $mailid1 = $_SESSION['mailid'];
  25. echo $mailid1;
  26. $query1="SELECT * FROM autoalto_mail where mail_id='".$mailid1."'" ;
  27.  
  28. //echo $query1;
  29. $result = mysql_query( $query1 );
  30. //echo mysql_num_rows($result) ;
  31. while($row = mysql_fetch_array($result))
  32. {
  33. echo $row['contents'];
  34. }
  35. mysql_close();
  36.  
  37. ?>
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 183
Reputation: lydia21 is an unknown quantity at this point 
Solved Threads: 5
lydia21 lydia21 is offline Offline
Junior Poster

Re: Help me .....

 
1
  #2
Jul 22nd, 2008
hope this works.plz reply
  1. while($row = mysql_fetch_array($result))
  2. {
  3. ?>
  4. <tr><td width="10%"></td><td ><img src="images/buldot.gif" alt="" height="6" width="6"><?echo $row['from']?></td>
  5. <td >
  6. <a href="contractor_mail_action_contents.php?mail_id=<? echo $row['mail_id']; ?>">
  7. <? session_start(); include('database.php');
  8. $mailid1 = $_GET['mail_id'];
  9. $query1="SELECT * FROM autoalto_mail where mail_id=$mailid1" ;
  10. $result = mysql_query( $query1 );
  11. while($row = mysql_fetch_array($result))
  12. {
  13.  
  14. echo $row['contents'];
  15. }mysql_close(); ?>
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 145
Reputation: ishlux is an unknown quantity at this point 
Solved Threads: 0
ishlux ishlux is offline Offline
Junior Poster

Re: Help me .....

 
0
  #3
Jul 22nd, 2008
Thanks a lot ..........its working,,,,,,,,i was struggling from yesterday.......
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 183
Reputation: lydia21 is an unknown quantity at this point 
Solved Threads: 5
lydia21 lydia21 is offline Offline
Junior Poster

Re: Help me .....

 
0
  #4
Jul 22nd, 2008
welcome............mark it as solved
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC