moviedrome Posted April 29, 2008 Share Posted April 29, 2008 I have the following stored in $response and this is what i get when i print_r $response (it continues to 80 rows but i haven't shown them all. What i need to do is be able to print for [0] [sStatus] for example and for [1] [iMerchantId]. I've tried printing them and i'm not sure what i'm doing wrong. Please help! stdClass Object ( [getTransactionListReturn] => Array ( [0] => stdClass Object ( [iId] => 15780442 [sStatus] => pending [sType] => normal [bPaid] => false [iPaymentId] => 0 [iMerchantId] => 1681 [fSaleAmount] => 1 [fCommissionAmount] => 40 [dClickDate] => 2008-04-13 12:15:10 [dTransactionDate] => 2008-04-13 13:20:16 [dValidationDate] => 2008-04-13 13:20:16 [sClickref] => jono310 [aTransactionParts] => Array ( [0] => stdClass Object ( [sCommissionGroupName] => default [fSaleAmount] => 1 [fCommissionAmount] => 40 [iCommission] => 40 [sCommissionType] => amount ) ) ) [1] => stdClass Object ( [iId] => 15961215 [sStatus] => confirmed [sType] => normal [bPaid] => false [iPaymentId] => 0 [iMerchantId] => 1952 [fSaleAmount] => 1.99 [fCommissionAmount] => 16 [dClickDate] => 2008-04-22 21:34:35 [dTransactionDate] => 2008-04-22 22:47:14 [dValidationDate] => 2008-04-29 10:06:13 [sClickref] => user48755offer75 [aTransactionParts] => Array ( [0] => stdClass Object ( [sCommissionGroupName] => Books Direct Top Gear x 2_0_1.99_2 [fSaleAmount] => 1.99 [fCommissionAmount] => 16 [iCommission] => 16 [sCommissionType] => amount ) ) ) Link to comment https://forums.phpfreaks.com/topic/103450-solved-stdclass-object-help-getting-variables/ Share on other sites More sharing options...
rhodesa Posted April 29, 2008 Share Posted April 29, 2008 print $response->getTransactionListReturn[0]->sStatus; print $response->getTransactionListReturn[1]->iMerchantId; Link to comment https://forums.phpfreaks.com/topic/103450-solved-stdclass-object-help-getting-variables/#findComment-529808 Share on other sites More sharing options...
moviedrome Posted April 29, 2008 Author Share Posted April 29, 2008 Thanks, i've just tried that and I get nothing displayed. Any idea why this could be? Link to comment https://forums.phpfreaks.com/topic/103450-solved-stdclass-object-help-getting-variables/#findComment-529848 Share on other sites More sharing options...
moviedrome Posted April 29, 2008 Author Share Posted April 29, 2008 ignore that, it's working now Thanks Link to comment https://forums.phpfreaks.com/topic/103450-solved-stdclass-object-help-getting-variables/#findComment-529850 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.