I am brand new in the PHP arena coming from the ASP.Net world.I am trying to generate my first PHP Datagrid in the following environment:

1. Windows XP2. Zend Studio 7.0.23. SQL Server 2000

The issue I am facing is that the SQL query generated by the PHP Datagrid has a wrong order of the SELECT, WHERE and ORDER BY parts. I saw a post in the forum (viewtopic.php?f=24&t=47&p=1283&hilit=sql+server#p1283) discussing the use of the SQL Server 2005 ROW_NUMBER() function. As this function is not available in SQL Server 2000, I use a column named RowNumber as primary field in the source tableThe code and the error message as shown below:

1) Wrong parameter in [RowNumber]: Check this field carefully, it may be not a Primary Key!

/////////////////////////////////////////////////////////////////////////ISSUE …../////////////////////////////////////////////////////////////////////////The syntax of the “search sql” is not correct and no records are retuned. If I modify the syntax (ORDER BY after the last part of the WHERE clause) the query returns records as expected. Unfortunately, I have no idea of how to solve the syntax issue in the PHP code.