What about wrapping it in a FOR loop:

for ($counter = 1; $counter <= $NumCases; $counter++) {
        // do the sql stuff
}

(http://www.php.net/manual/en/control-structures.for.php)

I don't think the type of database will make any difference to this.


HTH
Jon


-----Original Message-----
From: Wade Halsey [mailto:[EMAIL PROTECTED]]
Sent: 14 March 2001 06:13
To: [EMAIL PROTECTED]
Subject: [PHP] Execute sql a number of times


Hi

I need to execute an sql statement a certain number of times based on a
users input

/* number of times to execute
$NumCases = $HTTP_POST_VARS['txtNumCases'];

/* sql to run
$GetDetails = sqlexecute("select b.accno,b.debttype, c.surname, c.initial
,c.firstname, c.id_number, c.maidenname, c.addr_line1, c.addr_line2,
c.addr_line3, c.addr_code, c.telnum, c.postaddress1, c.postaddress2,
c.postaddress3, c.postpostcode, c.bankname, c.accountnumber,
c.accounttype,m.magdistrictname from  bad b, client c, magdistrict m where
b.accno = c.persal and m.code = b.magdistrictcode ");

I presume i need a while loop or someting similar but im really confused as
to how to implement it.

Please note that I am running an Interbase database

Any help would be greatly appreciated


**********************************************************************
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or confidentiality'

**********************************************************************

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to