Have error on_update

QuestionsHave error on_update
Rafael asked 11 years ago

Hello
I new on phpgrid, but I am haveing an error on on_update,
Code is.. am im using master detail sub grid sample, with some mod. for test.
I try , forceing the value , but I am getting a red line when press save

Thanks

$g->set_options($grid);

$e["on_update"] = array("update_client", null, true);
$g->set_events($e);
function update_client($data)
{
$str = "UPDATE invheader set total=(select sum(qty*unit) from invlines where id = {$data["id"]} ) WHERE id = {$data["id"]};";
//$str = "UPDATE invheader set total=1 WHERE id = {$data["id"]};";

// echo $str;

$mysql_query($str);
// echo $str;
// continue normal grid update … by grid lib
}

1 Answers
Abu Ghufran answered 10 years ago

Perhaps, there is a typo …

$mysql_query($str); should be …

mysql_query($str);
(without $ sign)

You can put echo statements inside on_update callback and see output in firebug ajax response.
Review this tutorial for '[debugging with firebug](https://phpgrid.desk.com/customer/portal/articles/926266)'.

Your Answer

20 + 3 =

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?