944,095 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1352
  • PHP RSS
Nov 27th, 2006
0

How would I write this asp code to work in PHP

Expand Post »
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"
Reputation Points: 10
Solved Threads: 0
Newbie Poster
buddybertling is offline Offline
1 posts
since Nov 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: html checkboxes...
Next Thread in PHP Forum Timeline: retrieving a particular value with a sql query





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC