jQWidgets Forums

jQuery UI Widgets Forums Grid Server-side Grid Edit with PHP & MSSQL

Tagged: , , ,

This topic contains 1 reply, has 1 voice, and was last updated by  jcf378 11 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Server-side Grid Edit with PHP & MSSQL #47432

    jcf378
    Participant

    Hi – I have successfully set up jqxGrid binding to a simple database housed on a remote MSSQL cluster by running the PHP scripts on our webserver. I have used the demos provided to create the data.php file to run the query, and essentially just changed the MYSQL commands to the appropriate MSSQL-based syntax. The PHP file generates the appropriate array and populates the grid accurately. However, I am now trying to get the server-side grid editing function to work in a similar fashion, and I cannot get the grid to accept the edits. I have again used the demos to create the appropriate PHP file with the $update_query, and the grid populates with the original data; but when I enter a change into a grid cell and press enter, it reverts back to the original and makes no change on the database side. Are there any other tweaks I need to make in the context of using MSSQL instead of MYSQL. My instincts tell me that something is happening where the $_GET[‘update’] parameter is not being set or transmitted appropriately when I make the grid edit, but I probably feel that way because that part of the process is embedded in the jquery codes and I can’t quite decipher those. Any thoughts?
    Many thanks,
    –Jason

    Server-side Grid Edit with PHP & MSSQL #47492

    jcf378
    Participant

    Actually – problem solved…. I believe there may be a syntax error in your code example file:

    http://www.jqwidgets.com/jquery-widgets-documentation/documentation/phpintegration/php-server-side-grid-editing.htm

    the $update_query string in your data.php file example has single quotes ( ‘ ) flanking the variable names (i.e., ‘LastName’ = …, ‘Title’ = …, etc.). Those single quotes aren’t necessary because that string is being processed by the subsequent mysql_query($update_query), and that query needs to read a straightforward SQL command line as simple text. The single quotes ARE necessary around the corresponding $_GET parameters however (i.e., ‘ “.$_GET[‘LastName’].” ‘ ), but not for the standalone fields in the SQL statement.

    Once those single quotes were removed, the rest of your example works great…
    many thanks,
    –Jason

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.