SmartRendering only showing first 50 rows

I am attempting to populate a grid from an Oracle database with smartrendering enabled. I believe my problem may be with telling the database to fetch the next 50 rows.
Here is the PHP code:

<?php

	error_reporting(E_ALL ^ E_NOTICE);

	if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
  		header("Content-type: application/xhtml+xml"); } else {
  		header("Content-type: text/xml");
	}
	echo("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
    if (!isset($_GET['count']))
        $_GET['count']=50;
    else
        sleep(1);
?>
<rows  pos="<?php echo $_GET['posStart']; ?>" total_count="20000">

<?php


$db = "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = xe)))";
	 $conn = ocilogon('grid','xxxxxx', $db);



	 if (!$conn) {
	    $e = oci_error();
	    print htmlentities($e['message']);
	    exit;
  }

  $sQuery = "SELECT id, item_nm from grid5000 where id between :posStart and :count ";

		$stid = oci_parse($conn, $sQuery);
		  if (!$stid) {
		   $e = oci_error($conn);
		   print htmlentities($e['message']);
		   exit;
		  }

oci_bind_by_name($stid, ":posStart", $_GET['posStart'], -1);
oci_bind_by_name($stid, ":count", $_GET['count'], -1);

		  $r = oci_execute($stid, OCI_DEFAULT);
		  if (!$r) {
		   $e = oci_error($stid);
		   echo htmlentities($e['message']);
		   exit;
	  }

	  while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS)) {
	  	//for($i=0; $i<300; $i++){
	  		print("<row id='r".($row[0]+$_GET['posStart'])."'><cell>".$row[0]."</cell><cell>index is ".($row[0]+$_GET['posStart'])."</cell> <cell>load turn started from ".$row[1]." + ".$_GET['count']."</cell><cell></cell><cell></cell><cell></cell><cell></cell><cell></cell></row>");
	  	//}


	  }
	?>
	  </rows>

The grid is called using the default example for ‘loading big datasets’. What is the counter that is passed via AJAX which I should include in the ‘where’ clause. Oracle does not have a LIMIT statement, so I have created a sequence variable called ID which I can then use as a row number. TIA.

There is next code in oracle’s version of connector, for dynamic data fetching.

SELECT * FROM ( select /*+ FIRST_ROWS(".$count.")*/dhx_table.*, ROWNUM rnum FROM (".$sql.") dhx_table where ROWNUM <= ".($count+$start)." ) where rnum >".$start;

where start and count - incoming parameters
sql - your main data selection query

Do I have to include start and count in the incoming URL, or does the software handle that. The calling grid code looks like the following:

	mygrid = new dhtmlXGridObject('gridbox');
	mygrid.setImagePath("../../codebase/imgs/");
	mygrid.setHeader("Item ID,Item Number,Item Serial");
	mygrid.setInitWidths("50,275,*")
	mygrid.setColAlign("right,left,left")
	mygrid.setColTypes("ed,ed,ed");
	mygrid.setColSorting("int,str,str")
	mygrid.init();
	mygrid.setSkin("dhx_skyblue")
    mygrid.enableSmartRendering(true,50);
    mygrid.loadXML("php/dynscroll.php");

“start” and “count” parameters are passed to the server side automatically when you scroll grid down. You don’t need to include them to income URL.