I'm trying to figure out on how can i translate the codes I've created in php mysql to php sqlsrv.
Basically, I used LIMIT in MySQL to limit the pagination. However, this is not supported in SQL Server and I'm really having a hard time like 3 months already to figure this out.
Below is the MySQL Code I wanted to translate on SQLSRV:
$start="";
$per_page = 1;
$start = $_GET['start'];
$max_pages = ($foundnum / $per_page);
if(!$start)
$start=0;
$getquery = mysql_query("SELECT * FROM knowledgebase WHERE $construct LIMIT $start, $per_page");
And below code is what I currently have issues running in SQLSRV:
$start="";
$per_page = 1;
$start = $_GET['start'];
$max_pages = ($foundnum / $per_page);
if(!$start)
$start=0;
$construct1 ="SELECT * FROM ENSEMBLE WHERE $construct";
$run1=sqlsrv_query($con,$construct1, array(), array('scrollable' => 'keyset'));
I can easily add LIMIT in the line of code $construct1 ="SELECT * FROM ENSEMBLE WHERE $construct"; but I didn't do it as it is not possible anyway.
Anyone can kindly help me out on how I can possible translate or rewrite it? TIA.