Subject RE: [firebird-php] Input arrays for use in stored procedures?
Author Alan McDonald
I still do the boring multiple calls to an SP via this method:

if (($_POST['saverecflags']=="ok")) {
foreach ($_POST as $fieldName=>$fieldValue) {
if (gettype($fieldValue) == 'array') {
$iCount = count($_POST[$fieldName]);
for ($i=0;$i<$iCount;$i++) {
$fieldValue = $_POST[$fieldName][$i];
if ($fieldName=='hrecon'){
if ($fieldName=='cbrecon') {

the fields on the page can be the same name as long as they are marked as an

<input type='checkbox' name='cbrecon[]' value=".$loanid."
".($C48=='Y'?'checked':'')." >

the looping in the script still goes on server side so I don;t see any
performance difference between scripting a page full of updates Vs executing
one SP with an array - the SP still has to execute multiple updates.
Anyway - passing array inputs... I don't go there :-)

-----Original Message-----
From: []On
Behalf Of willogibbo
Sent: Wednesday, 8 June 2005 5:46 PM
Subject: [firebird-php] Input arrays for use in stored procedures?

Hi all

I am developing a web based application using PHP with Firebird 1.5.
Certain pages take input from the user to update tables in the
database - all quite normal.

In some instances I have a form on which the user can change values
down a column in a recordset. I would like to be able to take these
multiple input values, as an array, and use them as input for a stored
procedure that does the updates as one "batch" (rather than construct
a loop in PHP, i.e.outside Firebird, that ends up doing multiple
individual ordinary update queries).

Question is, therefore, how is it possible to use multiple values i.e.
an array, as input parameter for a stored procedure, and for the SP to
loop through and process these values?

Thanks, Will

(this question posted to both this and Firebird-Support forum as I'm
not sure which is best?)

Yahoo! Groups Links

a.. To visit your group on the web, go to:

b.. To unsubscribe from this group, send an email to:

c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]