Ad:
 
  • PHP Discussion Thread
  • Unsolved
  • Views: 687
  • PHP RSS
Similar Threads
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 6:38 am.
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: 153
Solved Threads: 229
Nearly a Posting Virtuoso
rajarajan07 is offline Offline
1,398 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: 153
Solved Threads: 229
Nearly a Posting Virtuoso
rajarajan07 is offline Offline
1,398 posts
since May 2008
Message:
Previous Thread in PHP Forum Timeline: How to search a MySQL database
Next Thread in PHP Forum Timeline: PHP GET Navigation with AJAX





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


Follow us on Twitter


© 2010 DaniWeb® LLC