How would I write this asp code to work in PHP

Reply

Join Date: Nov 2006
Posts: 1
Reputation: buddybertling is an unknown quantity at this point 
Solved Threads: 0
buddybertling buddybertling is offline Offline
Newbie Poster

How would I write this asp code to work in PHP

 
0
  #1
Nov 27th, 2006
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"
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC