Advertisement
Guest User

Untitled

a guest
Jul 29th, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. <script>
  2.  
  3. function getVal() {
  4. document.getElementById("text2").value = document.getElementById("model").value;
  5.  
  6. <body>
  7.  
  8. <?php
  9. include('connect.php');
  10. $pname=$_GET['tpname'];
  11. $result = mysql_query("SELECT * FROM tblnpatient where pname='$pname'");
  12.  
  13. while($row = mysql_fetch_array($result))
  14. {
  15. $pnum=$row['pnum'];
  16. $addr=$row['addr'];
  17. }
  18. ?>
  19.  
  20. <tr><td>Patient Name:
  21. <div id="ma">
  22. <select name="pname" class="textfields" id="model" style="width:180px;" onchange="getVal();">
  23. <option id="0" >--Select Patient Name--</option>
  24. <?php
  25. $con=mysqli_connect("localhost","root","","dbnpatient");
  26. if (mysqli_connect_errno()){
  27. echo "Failed to connect to MySQL: " . mysqli_connect_error();
  28. }
  29. $pnum=$_GET['pnum'];
  30. $query = mysqli_query($con, "SELECT * FROM tblnpatient");
  31. while($row = mysqli_fetch_array($query)){
  32. $pnum = $row['pnum'];
  33. $pname = $row['pname'];
  34. ?>
  35. <option id="<?php echo $pnum; ?>" value="<?php echo $pname; ?>"><?php echo $pname; ?> </option>
  36. <?php } ?>
  37.  
  38. Address:<input type="text" name="ename" size="20" id="ma" value="<?php echo $addr ?>"/>
  39. Name:<input type="text" name="ename" size="20" id="ma" value="<?php echo $pname ?>"/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement