Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Oracle (https://www.askmehelpdesk.com/forumdisplay.php?f=443)
-   -   Where could I be going wrong in this Oracle PHP pagination? Table not populating (https://www.askmehelpdesk.com/showthread.php?t=598901)

  • Sep 26, 2011, 03:15 AM
    muithi
    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";

    ?>

  • All times are GMT -7. The time now is 04:30 PM.