473,394 Members | 1,739 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,394 software developers and data experts.

How to extract data from sql DB into the form

Hi All,

I am looking for the solution of following case.
I am trying to get the data from SQL DB in the form fields which i have created in the form. I am able to input through these fields but I also want to retrieve the data in the same form.
Please help me out as soon as possible. I attached the code for input form.

INPUT AND OUTPUT PAGE CODE (MAINPAGE.PHP)
Expand|Select|Wrap|Line Numbers
  1. <html> 
  2. <head>
  3. <!-- @@@@@@@@@@@@@@@@@@@@@@@@@ date Picker script @@@@@@@@@@@@@@@@@@@@@@@@@@@ -->
  4. <style>
  5.  
  6. label{
  7.  
  8. width: 6em;
  9.  
  10. float: left;
  11.  
  12. text-align: right;
  13.  
  14. margin-right: 8em;
  15.  
  16. display: block
  17.  
  18. }
  19.  
  20. </style>
  21.  
  22. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  23. <title>jsDatePick Javascript example</title>
  24.  
  25. <link rel="stylesheet" type="text/css" media="all" href="jsDatePick_ltr.min.css" />
  26. <!-- 
  27. OR if you want to use the calendar in a right-to-left website
  28. just use the other CSS file instead and don't forget to switch g_jsDatePickDirectionality variable to "rtl"!
  29.  
  30. <link rel="stylesheet" type="text/css" media="all" href="jsDatePick_ltr.css" />
  31. -->
  32. <script type="text/javascript" src="jquery.1.4.2.js"></script>
  33. <script type="text/javascript" src="jsDatePick.jquery.min.1.3.js"></script>
  34. <!-- 
  35. After you copied those 2 lines of code , make sure you take also the files into the same folder :-)
  36. Next step will be to set the appropriate statement to "start-up" the calendar on the needed HTML element.
  37.  
  38. The first example of Javascript snippet is for the most basic use , as a popup calendar
  39. for a text field input.
  40. -->
  41. <script type="text/javascript">
  42. window.onload = function(){
  43. new JsDatePick({
  44. useMode:2,
  45. target:"inputField",
  46. dateFormat:"%Y-%m-%d"
  47. /*selectedDate:{     This is an example of what the full configuration offers.
  48. day:5,     For full documentation about these settings please see the full version of the code.
  49. month:9,
  50. year:2006
  51. },
  52. yearsRange:[1978,2020],
  53. limitToToday:false,
  54. cellColorScheme:"beige",
  55. dateFormat:"%m-%d-%Y",
  56. imgPath:"img/",
  57. weekStartDay:1*/
  58. });
  59. };
  60. </script>
  61. <!-- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -->
  62. <title>Org Details</title> 
  63. </head> 
  64. <body> 
  65. <form method="post" action="insert5.php">
  66.  
  67. <h1>Insert the Following Details</h1>
  68. DATE: <input type="text" size="12" name="date" id="inputField" />
  69. <form method="post" action=""> 
  70. <table cellspacing="35">
  71. <tr><td><font face="verdana,arial" size=-1><Span><strong>Utilization:</strong></Span><td>
  72. <textarea rows="10" cols="50" name= "utilization">
  73.  
  74. </textarea>
  75. </td></tr>
  76. </table>
  77.  
  78. <table cellspacing="20">
  79. <tr><td><font face="verdana,arial" size=-1><Span><strong>Weekly Status:</strong></Span><td>
  80. <textarea rows="10" cols="50" name= "weekly_status">
  81.  
  82. </textarea>
  83. </td></tr>
  84. </table>
  85.  
  86.  
  87.  
  88. <table cellspacing="30">
  89. <tr><td><font face="verdana,arial" size=-1><Span><strong>DESUCCESS:</strong></Span><td>
  90. <textarea rows="10" cols="50" name= "desuccess">
  91.  
  92. </textarea>
  93. </td></tr>
  94. </table>
  95.  
  96.  
  97.  
  98. <table cellspacing="5">
  99. <tr><td><font face="verdana,arial" size=-1><Span><strong>ACCOMPLISHMENT:</strong></Span><td>
  100. <textarea rows="10" cols="50" name= "accomplishment">
  101.  
  102. </textarea>
  103. </td></tr>
  104. </table>
  105.  
  106.  
  107.  
  108. <table cellspacing="45">
  109. <tr><td><font face="verdana,arial" size=-1><Span><strong>ONCALL:</strong></Span><td>
  110. <textarea rows="10" cols="50" name= "oncall">
  111.  
  112. </textarea>
  113. <br><br> 
  114. <input type="submit" name="Submit" value="Submit"> 
  115. </form> 
  116. <?php 
  117.  
  118. ?> 
  119. </body> 
  120. </html> 
  121.  

INSERT.PHP

Expand|Select|Wrap|Line Numbers
  1.  
  2. <?php
  3. $con = mysql_connect("localhost","root","Oracle");
  4. if (!$con)
  5. {
  6. die('Could not connect: ' . mysql_error());
  7. }
  8.  
  9. mysql_select_db("test", $con);
  10.  
  11. $sql="INSERT INTO empinfo (orgdate, utilization, weekly_status, DE_sucess, accomplishment, oncall)
  12. VALUES
  13. ('$_POST[date]','$_POST[utilization]','$_POST[weekly_status]','$_POST[desuccess]','$_POST[accomplishment]','$_POST[oncall]')";
  14.  
  15.  
  16. if (!mysql_query($sql,$con))
  17. {
  18. die('Error: ' . mysql_error());
  19. }
  20. echo "1 record added";
  21.  
  22. mysql_close($con)
  23. ?> 
  24.  
Feb 22 '12 #1
0 1455

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

Similar topics

0
by: Ashok | last post by:
Hi, is it possible to extract data from a web based java applet in order to enter that data in mysql? for example, something that would let me extract the data shown in applet on...
0
by: David Lao | last post by:
Hi All, I need a way to extract Data value from the Outlook form when the new mails arrive. The data fields are provided. Thanks. David
8
by: nick | last post by:
Hi all can any one please tell me what is wrong in this code?? I'm new to deal with text files and extract data. i'm trying to look for data in a text file (3~4 pages) some lines start with a...
1
by: basyarie | last post by:
Hello All, I`d like to introduce myself. I`m basyarie, now is student of university. Nice to meet you all. I`m beginner in this discussion community. Just want to ask about VB6 for GPS...
2
by: missolsr | last post by:
hi, I am using jpcap to capture OLSR topology control (udp) packets. Does anyone know how to extract data (the way ethereal does it) from the olsr packet? There are methods to extract data...
4
by: bootzwiz | last post by:
Hi, I want to extract data between tags. For example i have following code <span class="t_t_12_b_b">Cast</span><span class="t_t_12_b">: <a href="/test/">Mel Gibb</a></span> I want to...
1
by: bibie | last post by:
How to extract data from mssql and then convert it to mysql using VB6.0. How to connect the mssql..I know a little bit of VB6.0 but only create an interface using STANDARD EXE. Someone told me to...
6
by: Savita23 | last post by:
I am trying to pass a query string from the main form to subform to display records in datasheet view.I tried using the following code in the form_load() event to populate the subform(Child0) ...
5
by: ElTipo | last post by:
Hello People, I made a data base with secure wizard to provide to users a PID and Passwords. I need to extract data from Crystal Reports 7 in this data base but Crystal Reports send me a message...
5
by: =?Utf-8?B?aWxy?= | last post by:
Hi This is probably fairly simple but I am newish at programming and was wondering if someone can give me some advice on handling the following. I have an array with a large number of elements...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.