CodeIgniter Forums
foreach simple problem. - 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: foreach simple problem. (/showthread.php?tid=46454)



foreach simple problem. - El Forum - 11-01-2011

[eluser]solid9[/eluser]
I have this error in view,

error message
Code:
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: views/prod_show.php
Line Number: 78

prod_show.php
Code:
<?php
//foreach($query as $row){
foreach($rows as $r):
   echo "<tr>";
   echo "<td>". $r->prod_name ."<br></td>";
   echo "<td>". anchor('prod_c/prod_edit/'.$r->prod_name, 'Edit') ."</td>";
   echo "<td>". anchor('prod_c/prod_delete/'.$r->prod_name, 'Delete') ."</td>";        
   echo "</tr>";
endforeach;        
?&gt;

I don't see aproblem with the foreach, can you see any problem with it?

Thanks in advanced.


foreach simple problem. - El Forum - 04-23-2012

[eluser]Unknown[/eluser]
Hi, I have the same problem, help us if there are any solutions... I have tried it for a few days...thanks for helping us before