Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple ADO scrolling recordset from MSSQL 1

Status
Not open for further replies.

MikeAuz1979

Programmer
Aug 28, 2006
80
AU
Hi,

Using PHP, Apache and a ms sql 2000 db I'm trying to recreate the simple scrolling through a recordset process as depicted on
I get everything except for the scroll links and I'm wondering if this method works for ms sql as well as Mysql which is used in the example.

Below is the code I'm using

Thanks for any help

Code:
<?php
	include_once('../adodb5/adodb.inc.php'); 
    include_once('../adodb5/adodb-pager.inc.php'); 
    session_start(); 

    $db = NewADOConnection('odbc_mssql'); 
    $dsn = "Driver={SQL Server};Server=localhost;Database=fb34_Yims;";
	$db->Connect($dsn, 'sa', 'potty');
    $sql  ="select acct_i from account";

    $pager = new ADODB_Pager($db,$sql); 
    $pager->Render($rows_per_page=5);
php?>
 
the closing tag for php is
Code:
?>
[/code
and not
[code]
php?>

i suspect that this is causing a fatal error that halts your code execution but that you have not got error reporting/display turned on.

try fixing the above and adding this to the top of your code

Code:
ini_set ('display_errors', 'on');
error_reporting (E_ALL);
 
Hey,

Thanks for answering, I'm not sure about your first point but your second point was spot on.

had an error in the adodb file adodb-lib.inc.php line 426. I then went googling and found that this line is most likely incorrect and can be fixed by replacing $rewritesql with $sql.

Thanks Mate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top