942,520 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 688
  • PHP RSS
Jul 7th, 2010
0

table in php

Expand Post »
this code is echoeing table the times i enter the reccord for a particular registration number.plx help me out!!!!
PHP Syntax (Toggle Plain Text)
  1. if(isset($_REQUEST["Submit"]))
  2. {
  3. $Registration_num=$_REQUEST['reg_num'];
  4. $query1=mysql_query("SELECT * from medicines where Registration_num = '$Registration_num'") ;
  5. while($row=mysql_fetch_array($query1))
  6. {
  7.  
  8. $query="select * from medicines where Registration_num='$Registration_num'";
  9. $result=mysql_query($query);
  10. mysql_query($query);
  11. echo "<table border=1>";
  12. echo "<br><tr><td><b> <font color='#CC66FF'>Id</td><td><b>Prescribed_med</td><td><b>allergic_med</td><td><b>Dosage_unit</td>";
  13.  
  14. while($row=mysql_fetch_array($result))
  15. {
  16.  
  17. $pr_med= $row[1];
  18. $al_med=$row[2];
  19. $d_unit=$row[3];
  20. $Id=$row[0];
  21.  
  22. echo "<tr><td><input name='checkbox' type='radio' value=$Id></td><td>". $pr_med."</td><td>". $al_med."</td><td>".$d_unit."</td></tr>";
  23. }
  24.  
  25. echo "</table>";
  26.  
  27. }
Last edited by @n@@; Jul 7th, 2010 at 7:38 am.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Member 784017 is offline Offline
4 posts
since Jul 2010
Jul 7th, 2010
0
Re: table in php
Post in a clear format, the text looks irritating
Reputation Points: 167
Solved Threads: 239
Nearly a Posting Virtuoso
rajarajan07 is offline Offline
1,445 posts
since May 2008
Jul 7th, 2010
0
Re: table in php
this code is echoeing table the times i enter the reccord for a particular registration number.plx help me out!!!!
i want the table to show all the values just once for the particular record
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Member 784017 is offline Offline
4 posts
since Jul 2010
Jul 7th, 2010
0
Re: table in php
Execute your query in phpadmin sqleditor to confirm whether it returns 1 or more rows
Reputation Points: 167
Solved Threads: 239
Nearly a Posting Virtuoso
rajarajan07 is offline Offline
1,445 posts
since May 2008

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: How to search a MySQL database
Next Thread in PHP Forum Timeline: Help me regarding preg_replace





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


Follow us on Twitter


© 2011 DaniWeb® LLC