CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 how to embed loop in a loop with CCS

Print topic Send  topic

Author Message
floppy

Posts: 3
Posted: 07/30/2004, 4:27 AM

i was wondering if i want to embed loop in a loop, but the codecharge may be does not work.

Any kind of help would be appreciated
View profile  Send private message
Benjamin Krajmalnik
Posted: 08/01/2004, 11:32 PM

This is in ASP, but should help.

'Retrieve Serial Numbers
CommaFlag = False
MyCount =
CLng(CCDLookUp("Count(SerialNumber)","SerialNumbers","FKInvoiceDetail =
"&LineItems.Recordset.Fields("InvoiceDetailKeyID"),DBMyDB))
' Read Invoice Number from URL
InvoiceNumber = CCGetFromGet("InvoiceNumber", 0)
If (InvoiceNumber > 0) and (MyCount > 0) then
SQL = "SELECT SerialNumber FROM SerialNumbers WHERE FKInvoiceDetail
="&LineItems.RecordSet.Fields("InvoiceDetailKeyID")
' Open the recordset
Set RecordSet = DBMyDB.Execute(SQL)
If DBMyDB.Errors.Count = 0 Then
If NOT RecordSet.EOF then
if MyCount > 1 then
LineItems.SerialNos.Value = MyCount&" Serial Numbers: "
else
LineItems.SerialNos.Value = "Serial Number :"
end if
WHILE NOT RecordSet.EOF
if CommaFlag = False then
LineItems.SerialNos.Value = Trim(LineItems.SerialNos.Value) &" "&
RecordSet.Fields("SerialNumber")
else
LineItems.SerialNos.Value = Trim(LineItems.SerialNos.Value) &", "&
RecordSet.Fields("SerialNumber")
end if
CommaFlag = True
RecordSet.MoveNext
WEND
End if
' Close the recordset
RecordSet.Close
Set RecordSet = Nothing
Else
End If
else
LineItems.SerialNos.Value = ""
End if


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.