0

I'm getting an empty drop down list while trying to populate it with values from an Oracle 10G website.

The drop down list appears, but there are no values inside of it. I also have error reporting on, but am not getting any errors.

Can anyone point out my error?

<tr>
  <td>Unit List</td>
    <td>
      <select name="unit">
          <?php 
              $conn = oci_connect("user", "password", "db");
              $sql = 'select ORGANIZATION_NAME from organization@something';
              $stid = oci_parse($conn, $sql);
              while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC))
              {
                  echo "<option value=\"unit1\">" . $row['ORGANIZATION_NAME'] . "</option>";
              }
          ?>
      </select>
    </td>
</tr>
2
  • 1
    Can you tell us what the error is first? Syntax? Unexpected output? You need to form a complete problem statement please. Commented Aug 23, 2013 at 18:30
  • @thatidiotguy, that's what's weird. I have error reporting on, but I'm not getting anything, it's just populating at all. Commented Aug 23, 2013 at 18:34

1 Answer 1

1

You're not executing the query, after parsing the query you need to execute it before fetching the results, the function you need is oci_execute(), used like this:

$success = oci_execute($stid)
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, that was it. For some reason I thought just calling "oci_fetch_array" would execute it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.