I need help :) |
[eluser]Unknown[/eluser]
hello sorry for bothering you guys. I'm still new to codeigniter and PHP/MySQL I just want to ask if what I did wrong why I can't make this code work. I did these codes but it seems not working on my end any error I made? I keep receiving this error message Quote:A PHP Error was encountered Code: Model: Code: Controller: Code: view:
[eluser]michalsn[/eluser]
Model: Code: if($qry->num_rows() > 0) Code: <?php foreach($posts->result_array() as $p):?> http://ellislab.com/codeigniter/user-gui...sults.html
[eluser]cideveloper[/eluser]
First thing I see is that $qry->num_rows > 0 should be $qry->num_rows() > 0 Do not forget the brackets. Secondly if your model returns FALSE which I think it is doing every time due to the above error $posts in your view will be the FALSE which will be an "Invalid argument supplied for foreach()"
[eluser]Unknown[/eluser]
guys thank you ... now I now why it is happening.. thank you so much +rep for the help guys.. |
Welcome Guest, Not a member yet? Register Sign In |