943,545 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 392
  • PHP RSS
Jul 22nd, 2008
0

Help me .....

Expand Post »
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.....

php Syntax (Toggle Plain Text)
  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. ?>
Reputation Points: 7
Solved Threads: 0
Junior Poster
ishlux is offline Offline
145 posts
since Jun 2008
Jul 22nd, 2008
1

Re: Help me .....

hope this works.plz reply
PHP Syntax (Toggle Plain Text)
  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(); ?>
Reputation Points: 19
Solved Threads: 5
Junior Poster
lydia21 is offline Offline
183 posts
since Nov 2007
Jul 22nd, 2008
0

Re: Help me .....

Thanks a lot ..........its working,,,,,,,,i was struggling from yesterday.......
Reputation Points: 7
Solved Threads: 0
Junior Poster
ishlux is offline Offline
145 posts
since Jun 2008
Jul 22nd, 2008
0

Re: Help me .....

welcome............mark it as solved
Reputation Points: 19
Solved Threads: 5
Junior Poster
lydia21 is offline Offline
183 posts
since Nov 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Is the syntax is correct..
Next Thread in PHP Forum Timeline: code to find out holidiays in a month





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC