473,503 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

fetching data in dropdown menu from the database

akhan
1 New Member
i used the following code to enter data in dropdown menu :
Expand|Select|Wrap|Line Numbers
  1. <?
  2. $con=mysql_connect("","","");
  3. mysql_select_db('investment',$con);
  4.  
  5. $query="select *from personal_info";
  6. $res = mysql_query($query);
  7. echo '<label>Select</label>';
  8. echo '<select id="id" name="val">';
  9. echo '<option value="">#</option>';
  10. while ($row = mysql_fetch_assoc($res)) 
  11. {
  12.      $va = $row['employee_id'];
  13. echo $va;
  14. echo "<option value='$va'>$va</option>";
  15. }
  16. echo '</select>';
  17. ?>
now, i want that whenever i click on the serial number inside the drop-down menu, i directly reach on the edit portion of data corresponding to that serial number (employee_id) which i can edit further.

PLEASE HELP ME...!!!!!
May 22 '07 #1
1 2307
Motoma
3,237 Recognized Expert Specialist
i used the following code to enter data in dropdown menu :
Expand|Select|Wrap|Line Numbers
  1. <?
  2. $con=mysql_connect("","","");
  3. mysql_select_db('investment',$con);
  4.  
  5. $query="select *from personal_info";
  6. $res = mysql_query($query);
  7. echo '<label>Select</label>';
  8. echo '<select id="id" name="val">';
  9. echo '<option value="">#</option>';
  10. while ($row = mysql_fetch_assoc($res)) 
  11. {
  12.      $va = $row['employee_id'];
  13. echo $va;
  14. echo "<option value='$va'>$va</option>";
  15. }
  16. echo '</select>';
  17. ?>
now, i want that whenever i click on the serial number inside the drop-down menu, i directly reach on the edit portion of data corresponding to that serial number (employee_id) which i can edit further.

PLEASE HELP ME...!!!!!
You will either need to post to another page (perhaps edit.php) or use AJAX to bring up an edit screen for the object. Then post the changes and perform the update.
May 22 '07 #2

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

Similar topics

1
3345
by: djharrison | last post by:
I'm new to ASP and database programming but I am trying to connect to a database using a concatenation of a strings and a menu item from a form. Ok here's what I have... an asp form that has a...
1
1051
by: Kate Hudson | last post by:
I'm creating a Web Form that has a lot of controls. The first control is an HTML DropDown that contains IDs populated through an ADODB Recordset object. I would like to dynamically fetch data in...
8
10242
by: Edgar | last post by:
Tools: SQL Server 2K, Excel 2000 Hi, I have an Excel report worksheet with formatted headings. What I want to do is to export data from the SQL server into a specific cell of the excel file....
22
2662
by: Sandman | last post by:
So, I have this content management system I've developed myself. The system has a solid community part where members can register and then participate in forums, write weblogs and a ton of other...
3
2139
by: Eric Layman | last post by:
HI, I have a select menu <select id="country" runat="server" class="myformat "> <option value="AFGHANISTAN">AFGHANISTAN</option> <option value="ALBANIA">ALBANIA</option>
1
2706
by: mahitha1 | last post by:
i have been trying to insert data into database from an html form which contain dropdown menus and text boxes in php using mysql as database.but iam getting the message that record has been added but...
3
2163
by: anu1208 | last post by:
Can I get help for retrieving data from database and displaying in dropdown menu
0
2194
by: Sky | last post by:
I have an Access 2003 front-end database with custom toolbars. The toolbars work fine. One annoying feature is that at the far right edge of each custom toolbar there a small dropdown arrow....
0
7205
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
7093
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
7353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5596
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
401
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.