RE: [PHP] Execute sql a number of times

From: Date: Wed, 14 Mar 2001 11:53:47 +0000
Subject: RE: [PHP] Execute sql a number of times
Groups: php.general 
Request: Send a blank email to php-general+get-43811@lists.php.net to get a copy of this message
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:whalsey@btech.co.za] Sent: 14 March 2001 06:13 To: php-general@lists.php.net 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' **********************************************************************

« previous php.general (#43811) next »