Monrach 0 Newbie Poster

Getting an empty drop-down list by the following code. Trying to fetch names from the department table. Using an oracle Database...

<label for="department">Department</label>
<select class="form-control" name="deptname" id="deptname">
           <option selected disabled></option>
           <?php 
            $dbUser = "...";
            $dbPass = "...";
            $dbConn = "(DESCRIPTION = (ADDRESS = (PROTOCOL=TCP)(HOST=...)(PORT=1521))(CONNECT_DATA=(SID=...)))"; 
            $conn = oci_connect($dbUser, $dbPass, $dbConn);
            $sql = oci_parse($conn,"SELECT Department1.NAME FROM Department1");
            oci_execute($sql, OCI_DEFAULT);
            ?>
              <?php
          while (oci_fetch($sql))
              { ?>
              echo '<option value="<?php echo oci_result($sql, 'NAME')?>"></option>
        <?php   
    }?>
           </select>  
Be a part of the DaniWeb community

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