If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Using variables with db2_bind_param

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-17-09, 11:05
tdavis tdavis is offline
Registered User
 
Join Date: Mar 2009
Posts: 6
Using variables with db2_bind_param

Is it possible to execute db2_bind_param using variables?
I cannot get this to work...

Code:
// Stored Procedure field names used //
$fields = array("siteid","account","p1csr","p1type",etc...
$usage  = array("DB2_PARAM_IN","DB2_PARAM_IN",etc....

// Define parameters //
for ($i=1; $i<=12; $i++) {
  	$fieldname = $fields[$i];
	$ID = ${$fieldname};
	db2_bind_param($stmt, $i, $ID, $usage[$i]);
}
Reply With Quote
  #2 (permalink)  
Old 04-20-09, 18:15
db2dummy1 db2dummy1 is offline
Registered User
 
Join Date: Feb 2009
Posts: 114
It is possible, according to this DB2 Database for Linux, UNIX, and Windows

The parser is probably choking on the array element in the third position in your example
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On