![]() |
What am I missing? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: What am I missing? (/showthread.php?tid=42756) |
What am I missing? - El Forum - 06-17-2011 [eluser]jshultz[/eluser] I'm not sure what I'm missing here. If I take the if/foreach/endif block out, then everything works fine. However, if I put that block in, then I get "Fatal error: Cannot use object of type stdClass as array" on "'type' => $row['@attributes']['type']," However, like I said, if that for php block is gone then it works just fine. I even hardcoded a select block in it's place and it works ok. Am I just missing something? I have the exact same block of code in another location on the page and it's not causing any errors anywhere around it. I'm lost. Code: <td><?php echo form_open_multipart('/callcenter/school_submit/'); ?> What am I missing? - El Forum - 06-18-2011 [eluser]jmadsen[/eluser] Look above: Code: $row->agentid your data is a stdObject, not an array. It looks like you changed $row midway, and messed up your data a bit. try changing foreach ($agents->result() as $row) to foreach ($agents->result() as $agent_row); i think that will fix What am I missing? - El Forum - 06-18-2011 [eluser]jshultz[/eluser] You know, I had almost tried that last night, but at the time I was sure that that wasn't the problem. I thought that since it was in it's own <?php ?> block that it would be fine. I didn't catch up above where I had opened up another if/foreach block (<?php if (isset($cb_offers) && count($cb_offers)) : foreach ($cb_offers as $row): ?> ![]() Thank you! ![]() What am I missing? - El Forum - 06-18-2011 [eluser]jmadsen[/eluser] no problem - only spotted it right away cuz I've done it myself ;-) |