This topic is locked

Updating a field in a different table

6/15/2009 10:55:27 AM
PHPRunner General questions
author

Another question about updating.
I have two fields in table A:
Credit

Debit
Credit will add to table B field `credit.hours`

Debit will subtract from table B field `credit.hours`
After I add the record in table A..Table B field `credit.hours` needs to update
This Code > global $conn;

$strUpdate = "UPDATE participation set `credit.hours` = '".$values["credit.hours"]."' where District='".$values["District"]."'";

echo $strUpdate;

db_exec($strUpdate,$conn)


is working to update Table B `credit.hours` but it is dependent on the '".$values["credit.hours"]."' I submit in Table A.
In order for my application to work `credit.hours` needs to respect the value submitted in table A.
Table A Table B Table B

Credit + `credit.hours` = `credit.hours`
Table B Table A Table B

`credit.hours` - Debit = `credit.hours`
Hope this makes sense.
Thanks for the help!!

500471 6/15/2009
K
katrinav 6/16/2009

that's great! congratulations! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=41902&image=1&table=forumreplies' class='bbc_emoticon' alt=':lol:' />
[right][/right]