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

4

1 回答 1

1

$aResult 是否已使用 PDO 检索到?如果是这样使用哪种方法?你用过获取吗?或者 fetchAll 如果你使用上面的方法和 $aResult['item] 你应该使用 fetch 如果不是并且你已经使用了 fetchAll 你需要 $aResult[0]['item'] 否则会产生一个空数组。这是我根据给出的信息的猜测

于 2013-06-13T21:37:35.650 回答