Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2009
    Posts
    6

    Unanswered: 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]);
    }

  2. #2
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •