$query = ' Declare @MemCode Varchar(12);
Declare @ConCounter decimal(28,0);
Set @MemCode = null;
Set @ConCounter = null;
EXECUTE spQMInsEventMember_TMS
"'.$masterEventCode.'",
"'.$eventCode.'",
'.$memberContactTitle.',
"'.$guestFirstName.'",
"'.$guestLastName.'",
'.$address.',
'.$townDescription.',
'.$countryCode.',
'.$postZip.',
'.$STD.',
'.$phone.',
"'.$guestEmail.'",
'.$isMember.',
'.$divisionCode.',
'.$statusCode.',
'.$subStatusCode.',
'.$memberTypeCode.',
'.$memberTitles.',
'.$memberSubType.',
'.$classCode.',
'.$subClassCode.',@MemCode OUTPUT,@ConCounter OUTPUT;
SELECT @MemCode AS member_code, @ConCounter AS contact_counter;';
//print_r($query);
$res = $this->dbh->query($query);
print_r $res;
输出:
object(stdClass)#1 (2) { ["RESULT"]=> string(2) "OK" ["CONTACTCOUNTER"]=> object(stdClass)#2 (1) { ["queryString"]=> string(522) " Declare @MemCode Varchar(12); Declare @ConCounter decimal(28,0); Set @MemCode = null; Set @ConCounter = null; EXECUTE spQMInsEventMember_TMS "AC", "LAC1112", NULL, "Fred", "Smith", NULL, NULL, NULL, NULL, NULL, NULL, "b@b.com", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,@MemCode OUTPUT,@ConCounter OUTPUT; SELECT @MemCode AS member_code, @ConCounter AS contact_counter;" } }