473,320 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

populate drop down menu cant retrieve value

Hi,

Actually I am working on populate drop down menu in which population work means all value for file no.come into drop down menu but cant retrieve data form mysql database.Its urgent for me so please help me.

popl.php
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2.   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
  4. <head>
  5.     <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  6.     <title>genome analysis lab</title>
  7. <link rel="stylesheet" type="text/css" media="screen" href="dbpage.css" />
  8. </head>
  9.  
  10. <script language="javascript" type="text/javascript">
  11. <!-- 
  12. //Browser Support Code
  13. function ajaxFunction(){
  14.     var ajaxRequest;  // The variable that makes Ajax possible!
  15.  
  16.     try{
  17.         // Opera 8.0+, Firefox, Safari
  18.         ajaxRequest = new XMLHttpRequest();
  19.     } catch (e){
  20.         // Internet Explorer Browsers
  21.         try{
  22.             ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
  23.         } catch (e) {
  24.             try{
  25.                 ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
  26.             } catch (e){
  27.                 // Something went wrong
  28.                 alert("Your browser broke!");
  29.                 return false;
  30.             }
  31.         }
  32.     }
  33.     // Create a function that will receive data sent from the server
  34.     ajaxRequest.onreadystatechange = function(){
  35.         if(ajaxRequest.readyState == 4){
  36.             var ajaxDisplay = document.getElementById('ajaxDiv');
  37.             ajaxDisplay.innerHTML = ajaxRequest.responseText;
  38.         }
  39.     }
  40.  
  41.     var fileno = document.getElementById('fileno').value;
  42.     var queryString = "?fileno=" + fileno;
  43.     ajaxRequest.open("GET", "nfret.php" + queryString, true);
  44.     ajaxRequest.send(null); 
  45. }
  46.  
  47. //-->
  48. </script>
  49.  
  50.  
  51.  
  52.  <body>
  53.  
  54.  
  55. <div id="container">
  56.     <div id="intro">
  57.         <div id="pageHeader">
  58.             <h1><span>Genome Analysis Lab</span></h1>
  59.             <h2><span>Purchase database</span></h2>
  60.         </div>
  61. &nbsp;&nbsp;<FONT size="5"><a href="date2.html">NAIP</a>&nbsp;&nbsp;&nbsp;
  62. <a href="date2.html"><blink>National Fellow</blink></a>&nbsp;&nbsp;&nbsp;
  63. <a href="date2.html">NFBSFARA</a></font>
  64. <br><br><br>
  65. <form action="nfret.php" method='get'>
  66. <p align ="left"><font color="#fff">
  67.  
  68. <font size="3pt"><b>Fileno</b>:</font> &nbsp;&nbsp;<?php include("pop.php"); ?>
  69.  
  70.  
  71. <br><br>&nbsp;&nbsp;
  72. <p align="left"><font color="#fff" size="3">
  73. <input type='button' onclick='ajaxFunction()' value='SUBMIT' /> </p>
  74. </p>
  75. </form>
  76. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  77.  
  78.  
  79.  
  80. <div id='ajaxDiv'><font size="4" color="#fff">Your result will be display here:</font></div>
  81.  
  82. <br><br><br><br>
  83. <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
  84. <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
  85. <div id="linkList">
  86.         <div id="linkList2">
  87.             <div id="lselect">
  88.                 <ul>
  89.                     <li><a href="naip1.html">Retrieval</a></li>
  90.                                                                           <li><a href="nfrc.html">Insertion</a></li>
  91.                                                                            <li><a href="nfmain.html">Home</a></li>
  92.                 </ul>
  93.             </div>
  94.  
  95. </body>
  96. </html>
pop.php

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $dbhost = 'localhost';
  4. $dbuser = 'root';
  5. $dbpass = '';
  6. $dbname = "purchase";
  7. $conn = mysql_connect($dbhost, $dbuser, $dbpass);
  8. mysql_select_db($dbname) or die(mysql_error());
  9. if(! $conn )
  10. {
  11.   die('Could not connect: ' . mysql_error());
  12. }
  13.  
  14. $sql = "SELECT fileno FROM nfone";
  15. $result = mysql_query($sql);
  16.  
  17. echo "<select name='fileno'>";
  18. while ($row = mysql_fetch_array($result)) {
  19.     echo "<option value='" . $row['fileno'] . "'>" . $row['fileno'] . "</option>";
  20. }
  21. echo "</select>";
  22.  
  23. ?>
nfret.php
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. error_reporting (E_ALL ^ E_NOTICE);
  3. $con = mysql_connect("localhost","root","");
  4. if (!$con)
  5. {
  6. die('Could not connect: ' . mysql_error());
  7. }
  8. mysql_select_db("purchase", $con);
  9.  
  10. $head = $_GET['head'];
  11. $description = $_GET['description'];
  12. $fileno=$_GET['fileno'];
  13. $Nameoffirm = $_GET['Nameoffirm'];
  14. $exp = $_GET['exp']; 
  15. $dateofsanction = $_GET['dateofsanction'];
  16. $dateofpo = $_GET['dateofpo'];
  17. $indentno = $_GET['indentno']; 
  18. $dateofindent = $_GET['dateofindent'];
  19. $billno = $_GET['billno'];
  20. $dateofbillno = $_GET['dateofbillno'];
  21. $BLno = $_GET['BLno'];
  22. $billpass = $_GET['billpass'];
  23. $billamt = $_GET['billamt'];
  24. $dateofbill = $_GET['dateofbill'];
  25. $availbal = $_GET['availbal'];
  26. $progbal = $_GET['progbal'];
  27. $remark = $_GET['remark'];
  28.  
  29. $result = mysql_query("SELECT * FROM nfone WHERE fileno = '$fileno'");
  30.  
  31. while($row = mysql_fetch_array($result))
  32. {
  33. echo "&nbsp;&nbsp;&nbsp;head &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' name='head' value='".$row['head']."'><br/><br/>";
  34. echo "&nbsp;&nbsp;&nbsp;description &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' name='description' value='".$row['description']."'><br/><br/>";
  35. echo "&nbsp;&nbsp;&nbsp;fileno &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='varchar' name='fileno' value='".$row['fileno']."'><br/><br/>";
  36. echo "&nbsp;&nbsp;&nbsp;Nameoffirm &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' name='Nameoffirm' value='".$row['Nameoffirm']."'><br/><br/>";
  37. echo "&nbsp;&nbsp;&nbsp;exp &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='int' name='exp' value='".$row['exp']."'><br/><br/>";
  38. echo "&nbsp;&nbsp;&nbsp;dateofsanction &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='date' name='dateofsanction' value='".$row['dateofsanction']."'><br/><br/>";
  39. echo "&nbsp;&nbsp;&nbsp;dateofpo &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='date' name='dateofpo' value='".$row['dateofpo']."'><br/><br/>";
  40. echo "&nbsp;&nbsp;&nbsp;dateofindent &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='date' name='dateofindent' value='".$row['dateofindent']."'><br/><br/>";
  41. echo "&nbsp;&nbsp;&nbsp;billno &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='int' name='billno' value='".$row['billno']."'><br/><br/>";
  42. echo "&nbsp;&nbsp;&nbsp;dateofbillno &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='date' name='dateofbillno' value='".$row['dateofbillno']."'><br/><br/>";
  43. echo "&nbsp;&nbsp;&nbsp;BLno &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='int' name='BLno' value='".$row['BLno']."'><br/><br/>";
  44. echo "&nbsp;&nbsp;&nbsp;billpass &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='varchar' name='billpass' value='".$row['billpass']."'><br/><br/>";
  45. echo "&nbsp;&nbsp;&nbsp;Head &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='int' name='billamt' value='".$row['billamt']."'><br/><br/>";
  46. echo "&nbsp;&nbsp;&nbsp;dateofbill &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='date' name='dateofbill' value='".$row['dateofbill']."'><br/><br/>";
  47. echo "&nbsp;&nbsp;&nbsp;availbal &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='int' name='availbal' value='".$row['availbal']."'><br/><br/>";
  48. echo "&nbsp;&nbsp;&nbsp;progbal &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='int' name='progbal' value='".$row['progbal']."'><br/><br/>";
  49. echo "&nbsp;&nbsp;&nbsp;remark &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='varchar' name='remark' value='".$row['remark']."'><br/><br/>";
  50.  
  51. }
  52.  
  53. mysql_close($con);
  54. ?>
May 3 '13 #1
0 1029

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: julian | last post by:
hi I was wondering if anyone can help me out on this.... I have dynamcally populated a drop down menu with data from an access database using ASP. The values seem fine, however when i pass...
6
by: Greg Scharlemann | last post by:
I am attempting to populate a drop down menu based on the selection of a different drop down menu. However, it is not working correctly, I cannot figure out for the life of me what exactly happens...
1
by: Greg Scharlemann | last post by:
I would like to automatically populate a drop down menu when the page loads based on the selection of an item in a different drop down menu. I made a test page that when drop down #1 changes, drop...
5
by: MickG | last post by:
Hi, I want my drop down box to be able to return wrap =0. It works fine with 2.95 and 3.95 but does bot return a 0. Could anyone help? <select name="bookwrapping"...
8
by: barbarowa | last post by:
I've coded a script to populate a drop down menu from a database but I can't seem to get the PHP script to pass the selected item. The database only has two fields, ID and ITEM. I want the user...
2
by: Parz | last post by:
Hi am facing problem in retrieving the value selected from drop down menu in one page from the next page..Am using the following code to populate the drop down menu with values form the database. ...
2
by: millertime90 | last post by:
Hi basically my problem is I have 2 drop down menus populated by my database the first populated by a field in the database and the 2nd populated with a relation to the value selected in the first...
2
by: giandeo | last post by:
Hello all, It's almost a couple of weeks since i am struggling to get this code work. Unfortunately, i am stuck. There seems to be no hope... Please Help....... I am working with an asp page...
5
by: giandeo | last post by:
Hello Experts. Could you find a solution for this problem please! I have the following tables in Access Database Table Name: origin Fields Names: country, countrycode Table Name: make...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.