J
|
Jane 11/28/2006 |
Hi, function BeforeAdd(&$values) { global $conn; $strSQLInsert ="UPDATE class_names SET class_amount=(class_amount-1) WHERE class_name ='".$values["YourDropdownField"]."'"; db_exec($strSQLInsert,$conn); return true; } function BeforeDelete($where) { global $conn; $str = "select Battle_Date from class_names where ".$where; $rs = db_query($str,$conn); $data = db_fetch_array($rs); $strSQLInsert ="UPDATE class_names SET class_amount=(class_amount+1) WHERE class_name ='".$data["YourDropdownField"]."'"; db_exec($strSQLInsert,$conn); return true; } |
I
|
iandouglas author 11/28/2006 |
Thank you so much. The first part of the code works great but the last part is not updating the class_amount field. |
J
|
Jane 11/29/2006 |
Battle_Date is your actual field name in the class_names table. $str = "select * from TableName where ".$where; |
I
|
iandouglas author 11/29/2006 |
Thank you so much for your help. |