Code:
$i=0;
while ($i < $rows) {
$storage_id = mysql_result($giftCards,$i,"id");
$result[$storage_id]['display_name'] = mysql_result($giftCards,$i,"display_name");
$result[$storage_id]['image_icon'] = mysql_result($giftCards,$i,"image_icon");
$result[$storage_id]['currency'] = mysql_result($giftCards,$i,"currency");
$i++;
}
return $result;
Causes error:
Warning: Cannot use a scalar value as an array in /home/chosen/public_html/classes/giftcards.class.php on line 13
On several lines.
Anyone have any idea how to correct this? The only time this has popped up has been with the new VPS I setup. Works fine on other servers.
You haven’t declared $result as an array.
Put a
$result = array();before the loop.