custom message on submiting data

Questionscustom message on submiting data
german asked 1 year ago

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.

1 Answers
Abu Ghufran Staff answered 1 year ago

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”);

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

18 + 13 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?