Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to store the Oracle sql query result in multi dimension array in PHP
    text
    copied!<p>I've a PHP script to fetch the data from Oracle SQL. I need to include fetch statement in HTML code. Basically I want to process all PHP related and database related queries in PHP tag and wherever required, i can fetch the result from the array rather again include oci_fetch() and oci_result statements.</p> <p>e..g,</p> <pre><code>&lt;?php /* Database Connection*/ if(!$dbConn = oci_connect('WHSUSR','goldeneyex','MyServer.biz:1530/OSLTP')){ $err = oci_error(); trigger_error('Could not establish a connection: ' . $err['message'], E_USER_ERROR); }; /* Query to get Users last accessed appication */ $strSQLUserLogInDetails = "select v.user_name, max(start_time) from sessiont s inner join V_BO_USER_CODES v on v.user_obj_id = s.user_id where v.user_name not in ('KALIDO MDM Anonymous User', 'KALIDO MDM Publication Service User') group by v.user_name order by 2 desc"; $stmtUserLogInDetails = oci_parse($dbConn,$strSQLUserLogInDetails); if ( ! oci_execute($stmtUserLogInDetails) ){ $err = oci_error($stmtUserLogInDetails); trigger_error('Query failed: ' . $err['message'], E_USER_ERROR); }; ?&gt; </code></pre> <p>and HTML code below...</p> <pre><code>&lt;table class="table table-striped" title="List of Users who last accessed Kalido application"&gt; &lt;thead&gt;&lt;tr&gt;&lt;th&gt;User Name&lt;/th&gt;&lt;th&gt;Last Accessed On&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt; &lt;tbody&gt; &lt;?php while(oci_fetch($stmtUserLogInDetails)){ $uname = oci_result($stmtUserLogInDetails, 1); $datetime = oci_result($stmtUserLogInDetails, 2); print "&lt;tr&gt;&lt;td&gt;&lt;a href='userlevelreport.php?uname=".$uname."'&gt;" .$uname. "&lt;/a&gt;&lt;/td&gt;&lt;td&gt;".$datetime."&lt;/td&gt;&lt;/tr&gt;"; } ?&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload