This topic is locked
[SOLVED]

 Stock Update Query

10/5/2016 8:49:51 AM
PHPRunner General questions
A
azmi author

I need to execute query on button click event Or menu option, As below is query working fine.
---------------------------------------------------------

UPDATE tblMaster LEFT OUTER JOIN tblTransaction

ON tblMaster.Item_Id = tblTransaction.Item_Id

SET tblMaster.Issued = (SELECT IFNULL(SUM(tblTransaction.Quantity_Out),0)

FROM tblTransaction WHERE tblMaster.Item_Id = tblTransactionDetail.Item_Id ), tblMaster.Received = (SELECT IFNULL(SUM(tblTransaction.Quantity_In),0)

FROM tblTransaction WHERE tblMaster.Item_Id = tblTransaction.Item_Id )

---------------------------------------------------------
Any help highly appreciated.
Thanks

Nadeem

romaldus 10/5/2016



I need to execute query on button click event Or menu option, As below is query working fine.
---------------------------------------------------------

UPDATE tblMaster LEFT OUTER JOIN tblTransaction

ON tblMaster.Item_Id = tblTransaction.Item_Id

SET tblMaster.Issued = (SELECT IFNULL(SUM(tblTransaction.Quantity_Out),0)

FROM tblTransaction WHERE tblMaster.Item_Id = tblTransactionDetail.Item_Id ), tblMaster.Received = (SELECT IFNULL(SUM(tblTransaction.Quantity_In),0)

FROM tblTransaction WHERE tblMaster.Item_Id = tblTransaction.Item_Id )

---------------------------------------------------------
Any help highly appreciated.
Thanks

Nadeem


To create a custom button:
https://xlinesoft.com/phprunner/docs/inserting_button.htm

Sergey Kornilov admin 10/5/2016

Use 'Insert button' functionality, add your code to Server event. Use CustomQuery() function to execute your query:

https://xlinesoft.com/phprunner/docs/customquery.htm