buddybertling 0 Newbie Poster

I'm new to PHP so be gentle:)

I have this asp code that is working....how would I write this in php if I use the same db tables and fields.

The "class_amount" field will hold the total amount of students allowed, in this case 16.

When a new record is added using a "look up dropdown box", it subtracts 1 off the total until 16 records have been added, once this reaches zero you could have it that the class name vanishes from the "drop down list" so its not available for selection

Add Page CODE
Function BeforeAdd(dict)

strSQLInsert ="UPDATE class_names SET class_amount=(class_amount-1) WHERE class_name ='"&dict("course1")&"'"

dbConnection.Execute strSQLInsert

BeforeAdd = True
End Function


List Page CODE
Function BeforeDelete(where)

strSQLInsert ="UPDATE class_names SET class_amount=(class_amount+1) WHERE class_name ='"&rsTemp("course1")&"'"
dbConnection.Execute strSQLInsert
BeforeDelete = True
End Function

The dropdown box has the following where statement:
"class_amount>=1"