title: PHP - Need to echo/print result of Oracle query in web page
body: <p>I've been searching for a couple of days and tried various forms of oci-fetch and not using it at all.
  What I'm trying to do is (code follows) get a submitted user ID (that we use in our institution) and obtain first and last name initals, add the last 4 digits of SSN and send as the reset password for the user.</p>
  
  <p>I ran the first part of the sql in sql Developer, and satisfied myself that the desired outcome results.</p>
  
  <p>Where I'm having a problem is taking the result of the sql and using it to update the ldap, then send in a web page.  The holdup is obtaining the results of the sql via the php operations. Right now, I'm just trying to echo or print to make sure I'm getting the resultant password, but that's not happening.</p>
  
  <p>Here's the code (adjusted for security):</p>
  
  <pre><code>&lt;?php
  $user = STRTOUPPER($_POST['uid']); //get input text
  $conn = oci_connect("A_USER", "USER_PWORD&gt;*", "DBSID");
  
  if (!$conn) {
      $e = oci_error();
      trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
  }
  
  $query = "select UPPER(substr(a.per_lname,1,1)) || LOWER(substr(a.per_fname,1,1)) || a.per_sno from mccuser.Pers_info a where a.per_id = ('" . $user ."')";
  
  $stid = oci_parse($conn, $query);
  $success = oci_execute($stid);
  //From this point, I've tried different approaches, including not even using oci_fetch.
  
  oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC);
  $newpw = $success;
  echo $newpw;
  
  ?&gt;
  </code></pre>
  
  <p>I'd appreciate any suggestions.</p>
  
  <p>Thanks,
  dfonteno</p>