( https://i.stack.imgur.com/1LPVk.png )
i mention my link where output show when i press drop-down button
then show empty fields but i have values in my sql table link ( https://i.stack.imgur.com/YEopy.png) but it does
not execute my values in drop down list..i need help...when i show error it does not dispaly any error but show empty in dropdown list..
and my PHP code is:
`

<tr> <td>Country Name</td> <td> <select name="name"> <?php
  $conn = oci_connect("username", "pswrd", "db");
  $sql = 'SELECT name FROM country';
  $stid = oci_parse($conn, $sql);
  $success = oci_execute($stid);
  while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC)) 
  {
    echo "<option value=\"countryname1\">" . $row['name'] . "</option>";
  }
?> 

`

Re: Exclamation PHP Drop Down List Populated By Oracle Database Rows is empty 80 80

Method oci_fetch_array() will return all rows. Change to oci_fetch_assoc()

Re: Exclamation PHP Drop Down List Populated By Oracle Database Rows is empty 80 80

still my drop down list emty display

Re: Exclamation PHP Drop Down List Populated By Oracle Database Rows is empty 80 80

Try to handle other errors

    <tr> <td>Country Name</td> <td> <select name="name"> <?php
      $conn = @oci_connect("username", "pswrd", "db");
      $e = oci_error();
      if($e){
        exit($e['message']);
      }

      $sql = 'SELECT name FROM country';
      $stid = @oci_parse($conn, $sql);
      if(!$stid){
        $e = oci_error($conn);
        exit($e['message']);
      }
      $success = @oci_execute($stid);
      if(!$success){
        $e = oci_error($conn);
        exit($e['message']);
      }
      while ($row = oci_fetch_assoc($stid)) 
      {
        echo "<option value=\"countryname1\">" . $row['name'] . "</option>";
      }
    ?>
Re: Exclamation PHP Drop Down List Populated By Oracle Database Rows is empty 80 80

https://i.stack.imgur.com/dRS39.png
in this link show my output but still nothing display of my country name which i ll insert in my table which are shown in this link https://i.stack.imgur.com/YEopy.png

Re: Exclamation PHP Drop Down List Populated By Oracle Database Rows is empty 80 80

Are dropdown list fill by empty options or list is empty?

Re: Exclamation PHP Drop Down List Populated By Oracle Database Rows is empty 80 80

php code display list empty

Re: Exclamation PHP Drop Down List Populated By Oracle Database Rows is empty 80 80

https://i.stack.imgur.com/YEopy.png it seems like fill by empty options. Check "Inspect Element" in browser.
https://i.stack.imgur.com/dRS39.png Check your column names. In oracle db column name are not case sensitive but in PHP it's case sensitive.

Re: Exclamation PHP Drop Down List Populated By Oracle Database Rows is empty 80 80

https://i.stack.imgur.com/HUwMb.png this is my sql data in table. and i ll display name of column in this table in php code in drop-down list

Re: Exclamation PHP Drop Down List Populated By Oracle Database Rows is empty 80 80

Try echo "<option value=\"countryname1\">" . $row['NAME'] . "</option>";
Oracle DB usually return column names in upper case

Re: Exclamation PHP Drop Down List Populated By Oracle Database Rows is empty 80 80

yeah i ll already try this but nothing is change in output

Re: Exclamation PHP Drop Down List Populated By Oracle Database Rows is empty 80 80

how i solve this dropdown list display problem? i need help

Re: Exclamation PHP Drop Down List Populated By Oracle Database Rows is empty 80 80

Try echo "<option value=\"countryname1\">" . $row[(array_keys($row)[0])] . "</option>";

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.