0

( 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>";
  }
?> 

`

2
Contributors
12
Replies
51
Views
1 Month
Discussion Span
Last Post by AndrisP
0

still my drop down list emty display

0

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>";
      }
    ?>

Edited by AndrisP

0

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

Edited by AndrisP

0

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

0

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

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.