一个ORACLE分页程序
<!DOCTYPE HTML> <HTML> <HEAD> <TITLE>Paging Test</TITLE> <META NAME="Generator" CONTENT="TextPad 4.0"> <META NAME="Author" CONTENT="?"> <META NAME="Keywords" CONTENT="?"> <META NAME="Description" CONTENT="?"> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?"> <?php // How to split the result into pages, like 'limits' in MySQL? // =========================================================== // Tutorial by Neil Craig (neilc@netactive.co.za) // Date: 2001-06-05 // With this example, I will explain paging of database queries where the // result is more than the developer want to print to the page, but wish to // split the result into seperate pages. // The table "SAMPLE_TABLE" accessed in this tutorial has 4 fields: // PK_ID, FIELD1, FIELD2 and FIELD3. The types don't matter but you should // define a primary key on the PK_ID field. $display_rows = 5; // The rows that should be display at a time. You can // modify this if you like. // Connect to the Oracle database putenv("ORACLE_SID=purk"); putenv("ORACLE_HOME=/export/oracle8i"); putenv("TNS_ADMIN=$ORACLE_HOME/network/admin"); $OracleDBConn = OCILogon("purk","purk","lengana.world"); // This query counts the records $sql_count = "SELECT COUNT(*) FROM SAMPLE_TABLE"; // Parse the SQL string & execute it $row_count=OCIParse($OracleDBConn, $sql_count); OCIExecute($row_count); // From the parsed & executed query, we get the amount of records found.
本文地址:http://www.phprm.com/develop/4abf5eccfb548432a705cb8fdfaf1798.html
转载随意,但请附上文章地址:-)