473,479 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to select data from oracle db using loop under listbox

45 New Member
hi all,

i have a problem with loop in select statement.i m using code : [php]
<select name = "s" size = "1" >
<option selected>P-Code</option>
<option value="P01">P01 </option>
<option value="P02">P02 </option>
<option value="P03">P03 </option>
<option value="P04">P04 </option>
</select></td>[/php]
but i want to select all P-CODE from database using loop.

so how can i do this in php. can anybody please help me?
Feb 28 '08 #1
5 3745
ronverdonk
4,258 Recognized Expert Specialist
You have been around long enough to know that any code must be enclosed within code tags. And if you still don't know read the Posting Guidelines on the subject.

moderator
Feb 28 '08 #2
ronverdonk
4,258 Recognized Expert Specialist
Show the select statement you are going to use for populating the select list.

Ronald
Feb 28 '08 #3
boss1
45 New Member
hi
thanks for ur response.

the code i have sent u is using manually select item from the list of item and as many item i write inbetween option value that will show from html form.

but i want to retrieve and show all data in the list box for a specific field from database.


thanks.
Feb 28 '08 #4
ronverdonk
4,258 Recognized Expert Specialist
hi
thanks for ur response.
the code i have sent u is using manually select item from the list of item and as many item i write inbetween option value that will show from html form.

but i want to retrieve and show all data in the list box for a specific field from database.

thanks.
That is exactly why I asked you to show your MySQL select statement. So we can see how to fill the drop down list. Please show it.

Ronald
Feb 28 '08 #5
ronverdonk
4,258 Recognized Expert Specialist
I did not mean MySQL of course, but since I always do MySQL it is stuck in my keyboard. To show you what I mean here is a piece of code making a form with a select drop down box that is being populated by the database results (note: MySQL). Question: is this what you have in mind?[php] print "<form method='POST' action='".$_SERVER['PHP_SELF']."'}>\n";
print "<select name='selectit'>\n";
while ($info = mysql_fetch_row($result)) {
foreach ($info as $field)
print "<option value='$field'>$field</option>\n";
}
print "</select>\n";
print "<p><input type='submit' value='Submit' id='myButton'/></p>\n";
print "</form>";[/php]Ronald
Feb 28 '08 #6

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

Similar topics

12
6501
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
4
11246
by: headware | last post by:
I have a <select> control that contains many entries. It allows the user to multi-select a group of them, click a button, and store the selected data in a database. Normally they do this starting...
5
2449
by: Melissa Cowan | last post by:
I am using Access 2000. I have the Developer's handbook and got the code for the mulit select listbox from there. It sends the selected value to another listbox, lstselected. What I need to do is...
3
4626
by: google | last post by:
Hello, I am trying to create a listbox that users can select multiple entries on. I want Access to put each on of those selections in a different row on a particular table. This table will also...
6
12961
by: Chris Fink | last post by:
Does anyone know it is possible to include a small image(.gif .jpeg) within a <SELECT><option> so that the user would see the option text as well as a little image(icon) in the option? I know this...
5
4069
by: Matthew Wells | last post by:
I have a listbox set to simple multi select. For this example, users only select one item at a time. I have command buttons on the form for First, Previous, Next, Last, New (record). The form...
1
4006
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which...
4
5050
by: Vincent | last post by:
I have a list box that is bound to a table with many records. I have a select all button that when clicked, obviously, selects all of the items in the list box. However, it takes a fairly long...
17
3105
by: trose178 | last post by:
Good day all, I am working on a multi-select list box for a standard question checklist database and I am running into a syntax error in the code that I cannot seem to correct. I will also note...
0
7027
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
6899
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
7067
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
6847
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
5312
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,...
1
4757
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4463
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
2980
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
555
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.