PHP Classes

sql query syntax error

Recommend this page to a friend!

      PHP data grid class  >  All threads  >  sql query syntax error  >  (Un) Subscribe thread alerts  
Subject:sql query syntax error
Summary:When using MSSQL, queries using LIMIT return a syntax error.
Messages:1
Author:alfonsopilato
Date:2010-04-29 01:44:11
 

  1. sql query syntax error   Reply   Report abuse  
Picture of alfonsopilato alfonsopilato - 2010-04-29 01:44:11
$objGrid -> form('employee', true);
$objGrid -> conectadb("localhost", "mydbusername", 'mydbpassword', "mydbname", true, "MSSQL");


/* Select the table to use */
$objGrid -> tabla ("users");

/* Define fields to show */
$objGrid -> FormatColumn("Username", "User Name", 30, 30, 0, "50", "left");


When I use MSSQL, I get a syntax error with regards to use of LIMIT. This is because MSSQL does not have the LIMIT parameter.

The base class :


if (empty($this->sql))
//$strSelect = "SELECT $sqlFields FROM $this->tablename $where $groupby $orderby LIMIT $recno, $this->maxRec";
$strSelect = "SELECT $sqlFields FROM $this->tablename $where $groupby $orderby";

If i remove the LIMIT portion, I clear the syntax error, but get nothing posted in terms of data.

I'm gonna look further, but though I'd mention it.