hii, i trying to make a simple Job database with job table as master and multiple detail such as, receive, quote, delivery etc as detail. shown at job list page, the problem is, when i delete one of record of the detail table, such as P0002. the list page not shown Job record J0001 anymore even the record still on the job table. please see image job list page - job id not shown.jpg
how to make all master record shown when some of detail record are deleted.
@alfre91 I noticed that the error from the previous query was because of no data in the $modeldata['id_data'] being used in the query. the new solution would be to add this 👇
$sql = "UPDATE prueba SET prueba.data_list = (prueba.data_list - 1) WHERE id = ".$prueba_id; $db->rawQuery($sql);
to your Action After Delete. I hope this resolves your issue.
Attached the .ppm file below in case you encounter any issue.
i've the same problem, i can't update after delete below is my test project, simple inventory. using PHPRad Classic 2.7.1 Trial, i hope someone can help me. thank you
finally found newbee error, this is what i do: purchases>>Delete Page>> Action Before Delete:
//$count_qty = $db->rawQuery("SELECT SUM(received_number) FROM purchases WHERE product_id=$products_id");
//execute SQL statement and return the result //$params = array($products_id); //$count_qty = $db->rawQuery("SELECT SUM(received_number) FROM purchases WHERE product_id=$products_id", $params);
$sql = "UPDATE products SET products.received_inventory = (SELECT SUM(received_number) FROM purchases WHERE product_id=$products_id) WHERE id = $products_id "; $db->rawQuery($sql);
i originally want to use $count_qty instead a nested query, but it was fail to me. please suggest with better sql query.
@alfre91 I noticed that the error from the previous query was because of no data in the $modeldata['id_data'] being used in the query. the new solution would be to add this 👇
$sql = "UPDATE prueba SET prueba.data_list = (prueba.data_list - 1) WHERE id = ".$prueba_id; $db->rawQuery($sql);
to your Action After Delete. I hope this resolves your issue.
Attached the .ppm file below in case you encounter any issue.
i've the same problem, i can't update after delete below is my test project, simple inventory. using PHPRad Classic 2.7.1 Trial, i hope someone can help me. thank you