how to display the custom message if the record is not added.
i am unable to find where the record is added or not.
It shows the record added successfully but it is not actually getting added.
Hello,
If there is an error in SQL query and you have set $g->debug = 0; It will show genereic error_msg which can be changed by:
$g->error_msg = “Some issues occured in this operation, Contact technical support for help”;
Otherwise, it will show the SQL error in error box.
To overcome this, you can refer demos/editing/server-validation.php sample to check if all pre-conditions are met to insert data.
https://www.phpgrid.org/demo/demos/editing/server-validation.phps Line 46.
And further when running insert query, you can also pass third param “insert_id”. Then it will return newly inserted ID as well.
$new_id = $g->execute_query(“INSERT INTO …….”,false,”insert_id”);
You can check it and send message to client side: phpgrid_error(“Some issue occured”);