0

I have the following code:

$aResult = $db->exec_sql($sql);

    //dlog2("matt", __line__, $aResult);
        print_r($aResult);


        $params = array(
                        'store_id' => $aResult['iStoreID'],
                        'user_id' => $aResult['iUserID'],
                        'store_name' => $aResult['cStoreName'],
                        'store_url' => $aResult['cStoreURL'],
                        'rid' => $aResult['cRID'],
                        'affiliate_id' => $aResult['iAffiliateID'],
                        'team_id' => $aResult['iTeamID'],
                        'bizOP' => $aResult['cDefaultBizOpp'],
                        'showBizOPp' => $aResult['iShowBizOppDropdown'],
                        'boPosting' => $aResult['iEnableBOPosting'],
                        'brandinglevel' => $aResult['iBrandingLevel']
        );

       // dlog2("matt", __line__, $params);
        print_r($params);

$aResult is an array where the data is organized by column heading. However when I try to move the data to $params it returns an empty array. Any advice?

The idea is to going to set up a cron that will do an external post on $params

2
  • 3
    what does the output of print_r($aResult); look like? Commented Jun 13, 2013 at 20:43
  • show us what print_r($aResult); returns Commented Jun 13, 2013 at 20:44

1 Answer 1

1

The $aResult has it been retrieved using PDO? If so using which method? Have you used fetch? Or fetchAll if your using the method above with $aResult['item] you should use fetch if not and you have used fetchAll you would need $aResult[0]['item'] otherwise an empty array will be produced . This is my guess from the information given

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.