This topic is locked

Yet problem with automatic addition

1/10/2010 11:30:12 AM
PHPRunner General questions
S
sadisticmagician author

hi, I resume a my old question.

I want a automatic addition in a table.

Example:

Product 1 (10) Product 2 (200).

If I modify "Product 1" in (11) i want automatic subtraction in "Product 2" = (199).

Can help me? Thanks!

S
sadisticmagician author 1/11/2010



hi, I resume a my old question.

I want a automatic addition in a table.

Example:

Product 1 (10) Product 2 (200).

If I modify "Product 1" in (11) i want automatic subtraction in "Product 2" = (199).

Can help me? Thanks!


nobody can help me with this problem? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=46826&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' /> Jane help me <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=46826&image=2&table=forumreplies' class='bbc_emoticon' alt=':(' />

J
Jane 1/12/2010

Hi,
use Before record updated event on the Eventstab for this purpose.

Here is just a sample:

global $conn;

$strUpdate = "update tablename set Field2=Field2-".$values["Field2"]." where Field1='Product 2'";

db_exec($strUpdate,$conn);
S
sadisticmagician author 1/15/2010



Hi,
use Before record updated event on the Eventstab for this purpose.

Here is just a sample:

global $conn;

$strUpdate = "update tablename set Field2=Field2-".$values["Field2"]." where Field1='Product 2'";

db_exec($strUpdate,$conn);



hi Jane, i enter in before record updated ---> custom code and insert your code?
but the word "product 1" is missing? or do I replace "Field1" with "product 1"?

J
Jane 1/18/2010

Hi,
you should replace field1 and field2 with your actual field names, product2 with your real value.

S
sadisticmagician author 1/18/2010



Hi,
you should replace field1 and field2 with your actual field names, product2 with your real value.


Don't work <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=46972&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' /> i have try in this mode in a custom code:
global $conn;

$strUpdate = "update tablename set Deposit=Deposit-".$values["Deposit"]." where Store='Deposit'";

db_exec($strUpdate,$conn);

J
Jane 1/19/2010

It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

S
sadisticmagician author 1/19/2010



It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.


hi Jane, can I post a image to explain better? thanks

S
sadisticmagician author 1/26/2010



hi Jane, can I post a image to explain better? thanks



No help for this? thanks

J
Jane 1/26/2010

Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.