PHP return a custom error to grid


I am trying to force an error to grid from PHP connector before executing the select statement.

Is there any way to simply return some JSON/XML/String or anything else from PHP which would tell the grid that an error occured and display a message in the browser?

Here is my last attempt:

function mySelect($action){


Nothing happens and the data is loaded to the grid normally.

Thank you

The solution which you are using is correct. This code must stop any further processing and return a response with “error” status back to a client-side, where you can catch the response status and response text by using events of a dataprocessor … event.html

Thank you for the reply but I am trying to return an error and stop PHP from rendering any data back to DataProcessor/Grid

Thank you