Populating a combo box using values in a table

I am trying to populate a drop down box with values from a table. I have got so far.
The combo box is populated however the values in the box are blank.
Can some suggest the necessary modifications?
$query="select distinct(house_type) from tbl_accommodation";
$stmt = ociparse($conn, $query);
ociexecute($stmt);
echo '<select name="house_type">';
echo '<option value = "-1">Select:</option>';
while($row=ocifetch($stmt)) {
     echo '<option>' . $row['house_type'] . '</option>';
     echo '</select>';
Thanks

The ocifetch() function needs ociresult() to get the data. See
http://us.php.net/manual/en/function.oci-result.php
You might want to use oci_fetch_assoc() instead.
while($row=oci_fetch_assoc($stmt)) {
  echo '<option>' . $row['HOUSE_TYPE'] . '</option>';
}For associative arrays, use the column name in upper case.
NB Oci_fetch_assoc() is a PHP 5 function. If you don't have it, then
you are using PHP 4 which has a much older version of the OCI8
extension. I'd recommend upgrading PHP, or just replacing the old
OCI8 with a newer one. See other recent threads about how to do this.

Similar Messages

  • Populating Combo Box list value In Multiple Row

    Hi,
    i to have the same problem .
    I have used add_list_element to populate the list value of the combo box in multiple row.
    I am selecting the list value from the database where the combo box value will be different for each row. However, when i do this.
    All the previous row combo box list value will follow the combo box value in the last row. How can i resolve this?
    i tried with lov but hasnt had any sucesss.in case of LOV can we make the list to appear automatuically and select a value????i havent had much sucesss over it??
    is thr any work around for this apart from lov?

    Hi,
    which product or technology are you talking about ?
    Frank

  • Dependent combo boxes using webservice

    Hi All,
    I'm trying to create a depended combo boxes using af:selectOneChoice, using webservice datacontrol. When i try to change the value of the first combo box which has hard coded values (eg. Continent), The depended combo box (eg.Country) is empty. (which is returned via webservice) When i again change the value of the first combo box, I get the corresponding values(Countries) generated. The very first time when a value is selected is not binded to the model. Why is this happening and how to overcome this issue. I tried using the value change listener and assigned the current value to binding but there was no change in the behaviour.

    Thanks for your response Frank. The Sample worked fine. But when i try to implement the same i ran into issues.
    First, I created a combo box for continents and a managed bean.
    <af:selectOneChoice label="Region" id="soc1" autoSubmit="true"
                                  valueChangeListener="#{locateBean.setRegion}">
                <af:selectItem label="Asia" value="Asia" id="si3"/>
                <af:selectItem label="Europe" value="Europe" id="si2"/>
                <af:selectItem label="NA" value="NA" id="si1"/>
              </af:selectOneChoice>Then I created a combo box for countries using the webservice data control.
              <af:selectOneChoice value="#{bindings.Country.inputValue}"
                                  label="Country"
                                  required="#{bindings.Country.hints.mandatory}"
                                  shortDesc="#{bindings.Country.hints.tooltip}"
                                  id="soc2" partialTriggers="soc1">
                <f:selectItems value="#{bindings.Country.items}" id="si4"/>
              </af:selectOneChoice>In the managed bean as
        public void setRegion(ValueChangeEvent event) {
            this.region = (String)event.getNewValue();
        }1. When i run and select an continent, the values are not getting populated in the country combo box. If i refresh the page or select another value for the continent, then its is getting populated.
    2. When i tried to execute the operation manually at pagedef on value change event,
            OperationBinding operBinding = getBindings().getOperationBinding("GetCountryList");
            operBinding.execute();I'm getting an warning as <FacesCtrlListBinding> <getInputValue> ADFv: Could not find selected item matching value Afghanistan of type: java.lang.String in the list-of-values.Why the value binded to the managed bean or model is not getting updated for the first time. Is this the expected behavior.

  • Problem pre-populating a combo box

    Hello,
    I am having problems pre-populating a combo box from a process.
    This combo box field exists in the OIM User Form and in another process form.
    Both combo box fields are populated from the same Lookup Definition: Lookup.Jazztel.TipoDeDocumento which looks like this:
    Code Key Decode
    1      DNI (NIF)
    2     Pasaporte
    4     Visado
    6     Nº Identificación de Extranjero
    9     C.I.F.
    I've tried these methods to pre-populate the combo box:
    * Using an adapter with a SET VARIABLE Logic Task (this adapter returns the code key that is selected in the OIM User form).
    * Using an adapter that returns the decode field from the code key and pass it to the Process combo box.
    In these cases, the process form combo box is not pre-populated correctly. It always shows C.I.F.
    I tried modifying the combo box in the following way:
    Code Key Decode
    DNI (NIF)      DNI (NIF)
    Pasaporte      Pasaporte
    Visado     Visado
    Nº Identificación de Extranjero Nº Identificación de Extranjero
    C.I.F. C.I.F.
    and it get pre-populated correctly.
    I need the code keys to be numbers. Does anyone know how can a combo like this be pre-populated?
    Moreover and curiously, the process form combo box appears ordered alphabetically (according to the decode fields):
    Code Key Decode
    9     C.I.F.
    1      DNI (NIF)
    6     Nº Identificación de Extranjero
    2     Pasaporte
    4     Visado
    and the OIM User Form Combo box, appears ordered numerically (according to the code key numerical order):
    Code Key Decode
    1      DNI (NIF)
    2     Pasaporte
    4     Visado
    6     Nº Identificación de Extranjero
    9     C.I.F.
    Does anyone know why?
    Thank you very much

    Try prepopulate combobox by lookup code.
    But it must displayed as decode.

  • When i change the value of a combo box using a property node it displays the value not the item label

    I am using a combo box as a select list for text serial commands.  I have items like "engineering", "GUI", and "Scan" for the commands "MDE", "MDN", and MDS respectively which i have input as the corresponding value in the combo box.  so for example the label "engineering" has the value "MDE" in the combo box items list.  when the Vi starts it needs to read the current value MDE, MDN, or MDS and then i want it to display on the front panel the item text corresponding to that command value.
    To do this i have tried to read the serial command, ie MDS and then wire that to a "value" property of a property node of the combo-box, but instead of displaying the corresponding item label, "Scan", it displays the value "MDS" on the front panel instead.  i want the front panel to use the label text when choosing and displaying but the block diagram to use the serial commands.  Can this be done with a combo box?  I'm trying to use a combo box so i can keep it all text and avoid having to build a case statement to convert enums or rings from a numerical value to the text command.
    The correct text value is wired to the value property and it does exist in the combo-box.  I have unchecked "values match items" and selected to not allow undefined values.

    Don't use the value property node.  Use the Text.Text property node.  When creating the property node, select Text, then in the next pop-up box, select Text.
    - tbob
    Inventor of the WORM Global

  • Help needed on combo-box dynamic values??

    Hi ,
    i need to populate values in 2 combo-boxes where the values
    in the second combo is dependent on the first .. from db ...
    i.e if i select a value in 1 combo then the values in the second combo should be populated accordingly from the db..
    pls suggest on this.

    You can use onchange event of the first combo box, then you can submit a form sending the first combo box value, then response filling the second combo box.
    If you don't want to make a request, you should use ajax to get data from database.

  • Problem in populating 2nd combo box depending upon the selection of 1st

    Hi all,
    I have 2 combo boxes on my jsp page ,say continent and country . obviously the data in 2nd box is dependant on selection made in the 1st . I'm using MySQL with tomcat 5.0.7 . and JSP.
    The first combo box in one form and the 2nd in another. After submitting first i 'm populating the second combo also.
    But the problem is after submitting the first form the page gets refreshing and i can't see the selected continent in the first combo box.
    The javascript code used follows:
    function callCapture(form)
    var item = continent.cmbContinent.selectedIndex;
    document.country.hidContId.value=continent.cmbContinent.options[item].value;
    document.continent.action="country.jsp?hidContId="+document.country.hidContId.value+"&buttName="+document.country.buttName.value+"";
    document.continent.target="_self";
    document.continent.submit();
    some one pls help me asap !

    Hi Reegz,
    that's what i'm also doing and i'm successfull till populating the second combo box but how do I keep the previous inputs on the page and reload the page based on the change of a selection box?
    Is their any mistake in the javascript code:
    Here is the code:
    function callCapture(form)
    var item = continent.cmbContinent.selectedIndex;
    document.country.hidContId.value=continent.cmbContinent.options[item].value;
    document.continent.action="country.jsp?hidContId="+document.country.hidContId.value+"&buttName="+document.country.buttName.value+"";
    document.continent.target="_self";
    document.continent.submit();
    Pls help me...

  • Combo Box - List Value Property

    I have a combo box in a form (Forms 10G) which is populated at runtime using values from a parameter table.But when I generate the form it gives a warning message that the list item property has to be filled .
    The combo box should display only the values from the database but it should not have any default values.
    How can I supress the warning message and avoid entering the list values proeprty at design time.
    Thanks in Advance.

    The warning is part of forms functionality, but is just that, a Warning, and the form should compile if not an error exists. Not sure if there's a way to suppress it, and You can simply leave the list with no values in Your design, as You will provide them at runtime. If coding is ok Your list should display the values You extract from the DB

  • Combo Box Use Global Data issue

    I am using a drop down combo box to select a name, and have checked specifiy item values, am using the item numbers in a switch statement to populate other text boxes depending on selection of drop down.  These same items appear several times in the form, so am setting them to use global data.  All work great except for the textboxes bound using global data to the drop down.  In those results, it's putting the item number, not the text value.  How do I get the text value to show instead of the item value?  Thank you!

    Resolved it by changing the switch statement to use the text value instead of item number, and unchecked the specify item values in the combo box.  I would be interested for future use to learn how to do this, but no worries if not.  At least the form is operating the way it needs to.  Thanks.

  • Combo Box Valid Values Update

    Hi All,
    I'm developing a Form which has BP Code and a ComboBox which, after entering a valid Supplier in the BPCode EditText, updates the ComboBox with the Supplier Catalog Numbers of all the Items where the CardCode (in OITM) matches the BPCode.  I have this working for the first change of BPCode but when the BPCode changes I want to update the ComboBox ValidValues.  I have tried many methods but cannot remove the ValidValues which are already there.  I have tried linking the ComboBox to a DataTable, clearing the DataTable and rebinding but this doesn't seem to work either.
    Any help on removing ValidValues from a list when I don't know what is already there (as the VV list is now out of scope) or adding a data bound ComboBox would be most appreciated.
    Thanks in anticipation,
    David

    Hi David,
    Try following
            'get the reference to the state combo box
            oCombo = oForm.Items.Item("combo box unique id").Specific
            'remove existing items if any
            'before adding new items
            For Flag = 0 To oCombo.ValidValues.Count - 1
                oCombo.ValidValues.Remove(0, SAPbouiCOM.BoSearchKey.psk_Index)
            Next
    After this, use a recordset or datatable to retrieve the records, and than a loop to add valid values to the combo box.
    Rahul

  • Set a combo box using script

    Hi, I am building an AIR application that reads in XML to set
    up a form for editing and saving back the XML. I am using the
    standard flash components including the combo box. I am trying to
    set the combo box value to a value in the XML, say for instance
    alignment which only has the possible selection settings of "left",
    "center" or "right". I have looked through the documentation but I
    can't seem to find the right code that will set an existing combo
    box to the desired selection. I know my paths are correct as I can
    call the open() method to open the combo box. Anyone able to help.
    If I get this sorted and my application is as good as done.
    Cheers,

    have you tried combobox.selectedIndex=#

  • Locating on a location on GMap using combo box using SDK

    Hi All,
    I have a requirement to locate a city on google map using combo box. I want name of cities to appear in combo box and on selecting a city, map should be able to locate that city. This combo box will be visible on map itself. Combo box can be a component of either Xcelsius or Flex Builder.
    I think combo box dragged from Xcelsius component panel not able to communicate with google map which is embedded in form of swf through manage and packager.
    So, I tried with Flex Builder combo box component, but not able to done it. I am not getting the flow how to communicate between combo box and google map.
    I can locate a particular city giving a latitude and longitude through propertysheet.
    Please, if anyone could help me out asap.
    Thanks in advance!

    Hi Monammed,
    The said functionality should work. Please check your logic one more time. Also, try using some spreadsheet components mapped to the cells in question and understand how the data is flowing during run-time. This will help you test things. Delete spreadsheets when you are done with identifying the issue.
    Lets check the combo box mapping one more time : Map the source of the combo to the entire range; labels in the combo box ONLY to the country column in the source range(typically this may be the left most column in the range); selected item should be mapped to the cell that has the destination for the icon and the type for default selection may be dynamic. Well, if there is any hard-coding of values involved anywhere, do check the spellings and other trivial things.
    Do let me know if this was helpful and if you need any more help.
    Thanks,
    Prasanna

  • Combo box displays value instead of label

    I have several combo boxes on a vi that will occasionally start displaying the value of an certain items instead of the string label when an element is selected. The only way to fix it is to deleted the combo box and replace it with another. This has happened several times on the same vi. Sometimes it is ok when the vi is run in the IDE but shows up in an executable. Is this a bug?
    Thanks,
    Bill F

    I think this is to be expected. Your control will have a value with no associated text.
    It would be much more dangerous if LabVIEW would randomly change (e.g. coerce) the value when the strings array gets shorter by some mechanism.
    You have several possibilities, for example:
    (1) Check the value and coerce to the highest valid entry or switch to entry zero.
    (2) Keep the array of strings at constant size, but replace the unwanted entries with empty strings (see attached), the string "out of range", "invalid selection", or similar.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ComboMOD.vi ‏24 KB

  • Can I Display a Selection or Combo box using MIDP

    Hey All,
    How can I display a Selection or Combo box in My Form Using MIDlet. Please send a Way to do this. Thanks in Advance.

    Hi
    use 'List' for displaying menu..
    check the api for 'javax.microedition.lcdui.List' class
    regards
    williams

  • Needs multi column dynamic combo box using C#

    I need a dynamic Combo box to display multi columns on Drop Down Event 
    such as Stock Code, Make, Model,Sub Model, Measurement Type and so on for  my C# Application with Columns Headers 
    Please Help Me
    Thanks in Advance

    You should create a class that represents your model and then you could use a CompositeCollection as the ItemsSource of the ComboBox.
    Here is an example for you:
    namespace WpfApplication59
    public class YourModel
    public string StockCode { get; set; }
    public string Model { get; set; }
    //+ the rest of your properties
    MainWindow.xaml.cs:
    public partial class MainWindow : Window
    public MainWindow()
    InitializeComponent();
    List<YourModel> models = new List<YourModel>();
    models.Add(new YourModel() { Model = "m1", StockCode ="c1"});
    models.Add(new YourModel() { Model = "m2", StockCode = "c2" });
    cb.ItemsSource = models;
    MainWindow.xaml:
    <ComboBox x:Name="cb" Grid.IsSharedSizeScope="True" ItemsSource="{DynamicResource items}"
    xmlns:local="clr-namespace:WpfApplication59">
    <ComboBox.Resources>
    <CompositeCollection x:Key="items">
    <ComboBoxItem IsEnabled="False">
    <Grid TextElement.FontWeight="Bold">
    <Grid.ColumnDefinitions>
    <ColumnDefinition SharedSizeGroup="A"/>
    <ColumnDefinition Width="5"/>
    <ColumnDefinition SharedSizeGroup="B"/>
    </Grid.ColumnDefinitions>
    <Grid.Children>
    <TextBlock Grid.Column="0" Text="Model"/>
    <TextBlock Grid.Column="2" Text="Stock Code"/>
    </Grid.Children>
    </Grid>
    </ComboBoxItem>
    <Separator/>
    <CollectionContainer Collection="{Binding Source={x:Reference cb}, Path=DataContext}"/>
    </CompositeCollection>
    <DataTemplate DataType="{x:Type local:YourModel}">
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition SharedSizeGroup="A"/>
    <ColumnDefinition Width="5"/>
    <ColumnDefinition SharedSizeGroup="B"/>
    </Grid.ColumnDefinitions>
    <Grid.Children>
    <TextBlock Grid.Column="0" Text="{Binding Model}"/>
    <TextBlock Grid.Column="2" Text="{Binding StockCode}"/>
    </Grid.Children>
    </Grid>
    </DataTemplate>
    </ComboBox.Resources>
    </ComboBox>
    You could restyle the the templates (Grids) as per your requirements.
    Please remember to mark helpful posts as answer to close your threads and then start a new thread if you have a new question.

Maybe you are looking for

  • Calling Siebel web service from BPEL flow

    Hi, I am using Jdeveloper 10.1.3 to build BPEL. Does anyone have a sample to call Siebel web service from BPEL flow? I cannot make web service call success by adding partner link from BPEL flow. Error: Error Code: 10944642 Error Message: Error: Inbou

  • Clip's media files?

    My first movie... all going smoothly... working the project library, clips, music, sound effects all working just fine. But just opened up imovie to find that the right hand side of the project library does not contain any pictures or audio. Instead

  • Why does Flash generate invalid class names for library items?

    I imported a bunch of bitmaps (PNGs).  The library symbol names all included the full file name and its extension.  When I check "export for actionscript" it generates a class name based on the symbol name, and it includes the ".png", even though tha

  • ERROR: "Exception from HRESULT: 0x8007000B" While installing addon in win 7

    Dear Experts, i have stuck in addon installation it shows an error of "Exception from HRESULT: 0x8007000B" My addon is in C#.net and this Error comes only in Window 7 Regards, Sumeet Vaity

  • Not synching; not happy

    Ever since I updated iTunes software and updated iPhone software my synching feature with mobile me is no longer working for calendars nor email - I haven't explored contacts. This has been true for the last 10 days or more. I am at a complete loss a