Php calls the Stored Procedure Code of mssql 2000, which I made yesterday. Let's take a look at the code for calling the stored procedure of mssql using php.
$ Start = isset ($ _ GET ['start'])? $ _ GET ['start']: 0;
$ End = isset ($ _ GET ['end'])? $ _ GET ['end']: 0;
$ Pagesize = isset ($ _ GET ['pagesize'])? $ _ GET ['pagesize']: 0;
$ Stmt = mssql_init ("Bigdatabase", $ link) or die ("");
Mssql_bind ($ stmt, "@ pagesize", $ pagesize, SQLINT4 );
Mssql_bind ($ stmt, "@ start", $ start, SQLINT4 );
@ $ Ms_result = mssql_execute ($ stmt, false );
Mssql_query ("dump transaction tempdb WITH NO_LOG ");
Now let's take a look at the stored procedure functions of the mssql data table.
Create procedure Bigdatabase
@ Pagesize int,
@ Start int
AS
Declare @ bsql nvarchar (4000)
Set @ bsql = 'select top '+ str (@ pagesize) + 'username, from person where id not in (select top' + str (@ start) + 'id from person order by id asc) order by id asc'
Execute sp_executesql @ bsql