Ask Experts Questions for FREE Help !
Ask
    muithi's Avatar
    muithi Posts: 1, Reputation: 1
    New Member
     
    #1

    Sep 26, 2011, 03:15 AM
    Where could I be going wrong in this Oracle PHP pagination? Table not populating
    <?php
    /* Connection string to Oracle view */
    /* user is patients */
    /* password is patients */
    $conn=oci_connect('patients','patients','192.168.1 .100/hosecare');

    /* Query expected to do pagination and get records */
    $qry="select *
    from (select a.*, ROWNUM rnum
    from (select BILL_NO,AK_NO,PAT_NAME,VOUCHER_DATE,USER_NAME,PAYM ENT_AMT from patients WHERE VOUCHER_DATE >='01-Sep-2011' AND VOUCHER_DATE <='26-Sep-2011' AND SOURCE_LOCATION='KIAMBU CLINIC' ORDER BY VOUCHER_DATE)a
    where ROWNUM <=20)
    where rnum >=10;";


    $stid=oci_parse($conn,$qry);
    oci_execute($stid);

    /* Table begins here */
    echo "<table border='1'>\n";
    echo "<tr>\n";

    /* Table Column headers */
    echo "<td>".'<h3>BILL NO</h3>'."</td>";
    echo "<td>".'<h3>ACCOUNT NO</h3>'."</td>";
    echo "<td>".'<h3>PATIENT NAME</h3>'."</td>";
    echo "<td>".'<h3>VOUCHER DATE</h3>'."</td>";
    echo "<td>".'<h3>USER NAME</h3>'."</td>";
    echo "<td>".'<h3>PAYMENT AMOUNT</h3>'."</td>";
    echo "</tr>\n";

    /* Populating Table cells with records resulting from the pagination query */
    while($row=oci_fetch_array($stid,OCI_ASSOC+OCI_RET URN_NULLS)) {
    echo "<tr>\n";
    foreach($row as $item){
    echo "<td>".($item !==null ? Htmlentities($item,ENT_QUOTES) : "&nbsp;")." </td>\n";
    }
    echo "</tr>\n";
    }

    echo "</table>\n";

    ?>

Check out some similar questions!

How to write a store procedure in Oracle SQL Developer to fetch all row in a table? [ 1 Answers ]

I have a table in Oracle database and I want to retrive its all rows by using the stored procedure how can I do it? The Table Name is WM_USER_MASTER and fields are WM_USER_ID,USERNAME,WM_LAST_MODIFIED_DATE,WM_LAST_MODIFIED_BY

Connect with remote oracle database from PHP [ 5 Answers ]

Hi, I need to connect to a remote oracle database from a PHP script. Do I need to install any drivers or packages to connect with the remote database? When I use below code <?php if ($c = oci_connect("username", "passwd", "remote server IP")) { echo "Successfully connected to Oracle.";

Self-referenced table in Oracle 9i database for huge amounts of data [ 5 Answers ]

Hello! I'm designing a database (Oracle 9i) for payments registration system, obviously it will hold a VERY big amount of data, which is going to be changing constantly. There are so called “list payments”, which have several beneficiaries bound to it, additionally for transferring money to some...


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.